diff options
author | Daniel Mack <github@zonque.org> | 2015-09-10 13:46:14 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-09-10 13:46:14 +0200 |
commit | f33be3119806f96898dda6ade492fbdcdf8f79b8 (patch) | |
tree | 3c470fb770c5a19f848df0487f01af89b0aa6bea /coccinelle | |
parent | 89921f6ed085d77225204e160ce2cee99ed0c6fa (diff) | |
parent | 525d3cc746a037e8cc6b2e0ebaaf76a51856fa6b (diff) |
Merge pull request #1226 from poettering/coccinelle-fixes3
Third round of Coccinelle fixes
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/hashmap_free.cocci | 54 | ||||
-rw-r--r-- | coccinelle/strv_free.cocci | 27 |
2 files changed, 81 insertions, 0 deletions
diff --git a/coccinelle/hashmap_free.cocci b/coccinelle/hashmap_free.cocci new file mode 100644 index 0000000000..86b9542488 --- /dev/null +++ b/coccinelle/hashmap_free.cocci @@ -0,0 +1,54 @@ +@@ +expression p; +@@ +- set_free(p); +- p = NULL; ++ p = set_free(p); +@@ +expression p; +@@ +- if (p) +- set_free(p); +- p = NULL; ++ p = set_free(p); +@@ +expression p; +@@ +- if (p) { +- set_free(p); +- p = NULL; +- } ++ p = set_free(p); +@@ +expression p; +@@ +- if (p) +- set_free(p); ++ set_free(p); +@@ +expression p; +@@ +- hashmap_free(p); +- p = NULL; ++ p = hashmap_free(p); +@@ +expression p; +@@ +- if (p) +- hashmap_free(p); +- p = NULL; ++ p = hashmap_free(p); +@@ +expression p; +@@ +- if (p) { +- hashmap_free(p); +- p = NULL; +- } ++ p = hashmap_free(p); +@@ +expression p; +@@ +- if (p) +- hashmap_free(p); ++ hashmap_free(p); diff --git a/coccinelle/strv_free.cocci b/coccinelle/strv_free.cocci new file mode 100644 index 0000000000..0ad56f772f --- /dev/null +++ b/coccinelle/strv_free.cocci @@ -0,0 +1,27 @@ +@@ +expression p; +@@ +- strv_free(p); +- p = NULL; ++ p = strv_free(p); +@@ +expression p; +@@ +- if (p) +- strv_free(p); +- p = NULL; ++ p = strv_free(p); +@@ +expression p; +@@ +- if (p) { +- strv_free(p); +- p = NULL; +- } ++ p = strv_free(p); +@@ +expression p; +@@ +- if (p) +- strv_free(p); ++ strv_free(p); |