summaryrefslogtreecommitdiffstats
path: root/coccinelle
diff options
context:
space:
mode:
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);