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

*: code cleanup: remove if (x) free checks #891

Merged
merged 1 commit into from Aug 30, 2023
Merged

*: code cleanup: remove if (x) free checks #891

merged 1 commit into from Aug 30, 2023

Conversation

ThomasAdam
Copy link
Member

The C standard has always allowed the following to work:

free(NULL);

So there's no longer a need to do this:

if (x)
free(x);

Via "elfring" who provided the cocci script on which this change is
based.

Fixes #108

The C standard has always allowed the following to work:

free(NULL);

So there's no longer a need to do this:

if (x)
    free(x);

Via "elfring" who provided the cocci script on which this change is
based.

Fixes #108
@ThomasAdam ThomasAdam added this to the 1.0.8 milestone Aug 30, 2023
@ThomasAdam ThomasAdam self-assigned this Aug 30, 2023
@ThomasAdam ThomasAdam marked this pull request as ready for review August 30, 2023 19:09
@ThomasAdam ThomasAdam merged commit 15bd91b into main Aug 30, 2023
4 checks passed
@ThomasAdam ThomasAdam deleted the ta/gh-108 branch August 30, 2023 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Remove unnecessary null pointer checks
1 participant