systemd/coccinelle/mfree_return.cocci

10 lines
251 B
Plaintext
Raw Normal View History

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