]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - coccinelle/mfree_return.cocci
random-seed: reduce scope of variable
[thirdparty/systemd.git] / coccinelle / mfree_return.cocci
index 8119fe07f29f738f9749f8f46e63212fca054681..15e6c7d566bd08281e841892b3383500871da64f 100644 (file)
@@ -1,6 +1,8 @@
 @@
-expression p;
+/* Avoid running this transformation on the mfree function itself */
+position p : script:python() { p[0].current_element != "mfree" };
+expression e;
 @@
-- free(p);
+- free@p(e);
 - return NULL;
-+ return mfree(p);
++ return mfree(e);