From 6796073e330f49923c5134652ee085e29fc88002 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 9 Sep 2015 23:05:10 +0200 Subject: tree-wide: make use of the fact that strv_free() returns NULL Another Coccinelle patch. --- coccinelle/strv_free.cocci | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 coccinelle/strv_free.cocci (limited to 'coccinelle') 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); -- cgit v1.2.3-54-g00ecf