summaryrefslogtreecommitdiffstats
path: root/dev/coccinelle/ha_free.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'dev/coccinelle/ha_free.cocci')
-rw-r--r--dev/coccinelle/ha_free.cocci6
1 files changed, 6 insertions, 0 deletions
diff --git a/dev/coccinelle/ha_free.cocci b/dev/coccinelle/ha_free.cocci
new file mode 100644
index 0000000..0019039
--- /dev/null
+++ b/dev/coccinelle/ha_free.cocci
@@ -0,0 +1,6 @@
+@ rule @
+expression E;
+@@
+- free(E);
+- E = NULL;
++ ha_free(&E);