summaryrefslogtreecommitdiffstats
path: root/coccinelle
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-17 00:28:30 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-17 05:35:39 +0200
commit6b430fdb7c0c2c52ea69a7d56f23d739218b13d0 (patch)
tree5ddb3975a8146fbee7c114e41a967e2abf9caa11 /coccinelle
parentshared/install: use _cleanup_free_ (diff)
downloadsystemd-6b430fdb7c0c2c52ea69a7d56f23d739218b13d0.tar.xz
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 0000000000..8119fe07f2
--- /dev/null
+++ b/coccinelle/mfree_return.cocci
@@ -0,0 +1,6 @@
+@@
+expression p;
+@@
+- free(p);
+- return NULL;
++ return mfree(p);