diff options
author | Daniel Mack <github@zonque.org> | 2015-09-09 15:45:03 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-09-09 15:45:03 +0200 |
commit | 01da201420edfb2a57e384f109def05f25429305 (patch) | |
tree | 1c3090f3b5200ba62613285553afa0f7a6d30b9a /coccinelle | |
parent | README: document new /etc/mtab requirement (diff) | |
parent | util: introduce safe_fclose() and port everything over to it (diff) | |
download | systemd-01da201420edfb2a57e384f109def05f25429305.tar.gz systemd-01da201420edfb2a57e384f109def05f25429305.tar.bz2 systemd-01da201420edfb2a57e384f109def05f25429305.zip |
Merge pull request #1218 from poettering/safe-fclose
util: introduce safe_fclose() and port everything over to it
Diffstat (limited to 'coccinelle')
-rw-r--r-- | coccinelle/safe_fclose.cocci | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/coccinelle/safe_fclose.cocci b/coccinelle/safe_fclose.cocci new file mode 100644 index 000000000..6961cd016 --- /dev/null +++ b/coccinelle/safe_fclose.cocci @@ -0,0 +1,27 @@ +@@ +expression p; +@@ +- if (p) { +- fclose(p); +- p = NULL; +- } ++ p = safe_fclose(p); +@@ +expression p; +@@ +- if (p) +- fclose(p); +- p = NULL; ++ p = safe_fclose(p); +@@ +expression p; +@@ +- fclose(p); +- p = NULL; ++ p = safe_fclose(p); +@@ +expression p; +@@ +- if (p) +- fclose(p); ++ safe_fclose(p); |