Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Error Handling for Memory Allocation Functions #1650

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KellyLTran
Copy link

PLEASE NOTE the following text from the iperf3 license. Submitting a
pull request to the iperf3 repository constitutes "[making]
Enhancements available...publicly":

You are under no obligation whatsoever to provide any bug fixes, patches, or
upgrades to the features, functionality or performance of the source code
("Enhancements") to anyone; however, if you choose to make your Enhancements
available either publicly, or directly to Lawrence Berkeley National
Laboratory, without imposing a separate written license agreement for such
Enhancements, then you hereby grant the following license: a non-exclusive,
royalty-free perpetual license to install, use, modify, prepare derivative
works, incorporate into other computer software, distribute, and sublicense
such enhancements or derivative works thereof, in binary and source code form.

The complete iperf3 license is available in the LICENSE file in the
top directory of the iperf3 source tree.

  • Version of iperf3 (or development branch, such as master or
    3.1-STABLE) to which this pull request applies:

  • Issues fixed (if any):

  • Brief description of code changes (suitable for use as a commit message):
    This pull request implements error handling for the memory allocation functions involving the "malloc" and "calloc" functions. Particularly focused on return values for error cases, this pull request clarifies when certain memory allocations do not work, which allows developers to clearly identify mistakes and where the issue is. Error messages are also used for code readability and clarity. This aims to make testing and bug fixing easier and more efficient.

@bmah888
Copy link
Contributor

bmah888 commented May 30, 2024

Thanks for the pull request! Er, did you mean for those Zone.Identifier files to be added?

EDIT: I agree that giving more diagnostic information to help fix flaws are good.

One of the reasons that iperf3 is fairly terse with error messages is that in some places, printing out diagnostics can interfere with JSON output. This isn't the case everywhere but it requires a little thought about how to express additional information such as what you're proposing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants