aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-16 18:28:30 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-16 23:35:39 -0400
commit6b430fdb7c0c2c52ea69a7d56f23d739218b13d0 (patch)
tree5ddb3975a8146fbee7c114e41a967e2abf9caa11 /coccinelle
parentshared/install: use _cleanup_free_ (diff)
downloadsystemd-6b430fdb7c0c2c52ea69a7d56f23d739218b13d0.tar.gz
systemd-6b430fdb7c0c2c52ea69a7d56f23d739218b13d0.tar.bz2
systemd-6b430fdb7c0c2c52ea69a7d56f23d739218b13d0.zip
tree-wide: use mfree more
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/mfree_return.cocci6
1 files changed, 6 insertions, 0 deletions
diff --git a/coccinelle/mfree_return.cocci b/coccinelle/mfree_return.cocci
new file mode 100644
index 000000000..8119fe07f
--- /dev/null
+++ b/coccinelle/mfree_return.cocci
@@ -0,0 +1,6 @@
+@@
+expression p;
+@@
+- free(p);
+- return NULL;
++ return mfree(p);