Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements. https://git-scm.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
git/contrib/coccinelle/free.cocci

45 lines
362 B

@@
expression E;
@@
- if (E)
(
free(E);
|
free_commit_list(E);
)
@@
expression E;
@@
- if (!E)
(
free(E);
|
free_commit_list(E);
)
@@
expression E;
@@
- free(E);
+ FREE_AND_NULL(E);
- E = NULL;
@@
expression E;
@@
- if (E)
- {
free_commit_list(E);
E = NULL;
- }
@@
expression E;
statement S;
@@
- if (E) {
+ if (E)
S
free_commit_list(E);
- }