summaryrefslogtreecommitdiff
path: root/coccinelle
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
parentd7604756ca5888350d5ed4ab6867baa967b24299 (diff)
downloadsystemd-6b430fdb7c0c2c52ea69a7d56f23d739218b13d0.tar.gz
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);