Skip to content

Commit d73b46c

Browse files
committed
Merge branch 'rs/free-and-null'
Code cleanup. * rs/free-and-null: coccinelle: polish FREE_AND_NULL rules
2 parents 9bf8e0c + 76d8d45 commit d73b46c

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

contrib/coccinelle/free.cocci

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,9 @@ expression E;
1010
- if (!E)
1111
free(E);
1212

13-
@@
14-
type T;
15-
T *ptr;
16-
@@
17-
- free(ptr);
18-
- ptr = NULL;
19-
+ FREE_AND_NULL(ptr);
20-
2113
@@
2214
expression E;
2315
@@
2416
- free(E);
25-
- E = NULL;
2617
+ FREE_AND_NULL(E);
18+
- E = NULL;

0 commit comments

Comments
 (0)