1
0
Fork 0
systemd/coccinelle/mfree.cocci
Daniel Baumann ce097cb8f4
Adding upstream version 257.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 18:07:44 +02:00

36 lines
478 B
Text

/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
/* Avoid running this transformation on the mfree function itself */
position p : script:python() { p[0].current_element != "mfree" };
expression e;
@@
- free@p(e);
- return NULL;
+ return mfree(e);
@@
expression p;
@@
- free(p);
- p = NULL;
+ p = mfree(p);
@@
expression p;
@@
- if (p)
- free(p);
+ free(p);
@@
expression p;
@@
- if (p)
- mfree(p);
+ free(p);
@@
expression p;
@@
- mfree(p);
+ free(p);