mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
cocci: detect useless free(3) calls
Add a semantic patch for removing checks that cause free(3) to only be called with a NULL pointer, as that must be a programming mistake. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3b9e3c2ced
commit
ec6cd14c7a
|
@ -3,3 +3,9 @@ expression E;
|
|||
@@
|
||||
- if (E)
|
||||
free(E);
|
||||
|
||||
@@
|
||||
expression E;
|
||||
@@
|
||||
- if (!E)
|
||||
free(E);
|
||||
|
|
Loading…
Reference in a new issue