1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 02:21:44 +03:00
systemd/coccinelle/hashmap_free.cocci
Lennart Poettering 525d3cc746 tree-wide: take benefit of the fact that hashmap_free() returns NULL
And set_free() too.

Another Coccinelle patch.
2015-09-09 23:12:07 +02:00

55 lines
658 B
Plaintext

@@
expression p;
@@
- set_free(p);
- p = NULL;
+ p = set_free(p);
@@
expression p;
@@
- if (p)
- set_free(p);
- p = NULL;
+ p = set_free(p);
@@
expression p;
@@
- if (p) {
- set_free(p);
- p = NULL;
- }
+ p = set_free(p);
@@
expression p;
@@
- if (p)
- set_free(p);
+ set_free(p);
@@
expression p;
@@
- hashmap_free(p);
- p = NULL;
+ p = hashmap_free(p);
@@
expression p;
@@
- if (p)
- hashmap_free(p);
- p = NULL;
+ p = hashmap_free(p);
@@
expression p;
@@
- if (p) {
- hashmap_free(p);
- p = NULL;
- }
+ p = hashmap_free(p);
@@
expression p;
@@
- if (p)
- hashmap_free(p);
+ hashmap_free(p);