diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-02-16 14:45:13 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-02-16 14:45:13 -0800 |
commit | 0078a7598518a66c085311a11a0f25203b9ecce6 (patch) | |
tree | 899b4ab69e3658f2f8b88739e0b0e29d650c2120 /contrib | |
parent | 5a98255dec1578cc6dc3f25e85d7ea96028687b7 (diff) | |
parent | ec6cd14c7a869b32776c1d3387afc93f369aea62 (diff) | |
download | git-0078a7598518a66c085311a11a0f25203b9ecce6.tar.gz git-0078a7598518a66c085311a11a0f25203b9ecce6.tar.xz |
Merge branch 'rs/cocci-check-free-only-null'
A new coccinelle rule that catches a check of !pointer before the
pointer is free(3)d, which most likely is a bug.
* rs/cocci-check-free-only-null:
cocci: detect useless free(3) calls
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/coccinelle/free.cocci | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/coccinelle/free.cocci b/contrib/coccinelle/free.cocci index e28213161..c03ba737e 100644 --- a/contrib/coccinelle/free.cocci +++ b/contrib/coccinelle/free.cocci @@ -3,3 +3,9 @@ expression E; @@ - if (E) free(E); + +@@ +expression E; +@@ +- if (!E) + free(E); |