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

Delete unnecessary checks before some function calls #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

elfring
Copy link

@elfring elfring commented Oct 21, 2023

…on “free”

The function “free” is documented in the way that no action shall occur for
a passed null pointer. It is therefore not needed that a function caller
repeats a corresponding check.
https://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first

This issue was fixed by using the software “Coccinelle 1.1.1-00480-gd235ef51”.

Signed-off-by: Markus Elfring <[email protected]>
…on “cd_delete”

The function “cd_delete” of this software library tolerates also the passing
of null pointers. It is therefore not needed that a function caller
repeats a corresponding check.

Signed-off-by: Markus Elfring <[email protected]>
@lipnitsk
Copy link
Owner

Can you please add unit tests for these changes, just in case a later change breaks this behavior.

@elfring
Copy link
Author

elfring commented Oct 23, 2023

Can you follow the desire for the avoidance of redundant checks before shown function calls?

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