mirror of
https://github.com/systemd/systemd
synced 2024-10-02 22:37:25 +00:00
cocci: merge mfree.cocci and mfree_return.cocci (#30838)
It makes sense that these should be one file instead of two, as they both involve mfree()
This commit is contained in:
parent
5ba46b99f7
commit
d7d6195953
|
@ -1,7 +1,36 @@
|
||||||
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
/* 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;
|
expression p;
|
||||||
@@
|
@@
|
||||||
- free(p);
|
- free(p);
|
||||||
- p = NULL;
|
- p = NULL;
|
||||||
+ p = mfree(p);
|
+ 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);
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
/* 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);
|
|
Loading…
Reference in a new issue