-
Notifications
You must be signed in to change notification settings - Fork 7.9k
tree-wide: Do not manually check for NULL
before calling free()
#19063
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
base: master
Are you sure you want to change the base?
Conversation
Changes performed with Coccinelle: @@ expression e; @@ - if (e) { efree(e); - } @@ expression e; @@ - if (e) { efree(e); e = NULL; - } @@ expression e; @@ - if (e) { free(e); - } @@ expression e; @@ - if (e) { free(e); e = NULL; - } @@ expression e, e2; @@ - if (e) { pefree(e, e2); - } @@ expression e, e2; @@ - if (e) { pefree(e, e2); e = NULL; - }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor CS nits but looks nice :)
efree((*session)->a); \ | ||
(*session)->a = NULL; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
efree((*session)->a); \ | |
(*session)->a = NULL; \ | |
efree((*session)->a); \ | |
(*session)->a = NULL; \ |
/* malloc was used to store value */ | ||
efree(dbuf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* malloc was used to store value */ | |
efree(dbuf); | |
/* malloc was used to store value */ | |
efree(dbuf); |
efree(error); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
efree(error); | |
} | |
efree(error); | |
} |
the title caught me :) so not just free but zendmm api flavors. |
Changes performed with Coccinelle: