diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/coccinelle/free.cocci | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/coccinelle/free.cocci b/contrib/coccinelle/free.cocci index 4490069df9..6fb9eb6e88 100644 --- a/contrib/coccinelle/free.cocci +++ b/contrib/coccinelle/free.cocci @@ -2,13 +2,21 @@ expression E; @@ - if (E) +( free(E); +| + free_commit_list(E); +) @@ expression E; @@ - if (!E) +( free(E); +| + free_commit_list(E); +) @@ expression E; @@ -16,3 +24,22 @@ 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); +- } |