Merge branch 'rs/free-and-null'

Code cleanup.

* rs/free-and-null:
  coccinelle: polish FREE_AND_NULL rules
This commit is contained in:
Junio C Hamano 2017-07-10 13:42:51 -07:00
commit d73b46cfb5

View File

@ -10,17 +10,9 @@ expression E;
- if (!E) - if (!E)
free(E); free(E);
@@
type T;
T *ptr;
@@
- free(ptr);
- ptr = NULL;
+ FREE_AND_NULL(ptr);
@@ @@
expression E; expression E;
@@ @@
- free(E); - free(E);
- E = NULL;
+ FREE_AND_NULL(E); + FREE_AND_NULL(E);
- E = NULL;