summaryrefslogtreecommitdiffstats
path: root/coccinelle/mfree_return.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'coccinelle/mfree_return.cocci')
-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 0000000..8119fe0
--- /dev/null
+++ b/coccinelle/mfree_return.cocci
@@ -0,0 +1,6 @@
+@@
+expression p;
+@@
+- free(p);
+- return NULL;
++ return mfree(p);