diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-09 15:20:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-09 15:26:11 +0200 |
commit | 74ca738f6a01fb5fc19c5c3899f5cb1fdc1d7f68 (patch) | |
tree | 920d0abca454976756296d982d1cb9ef794e1ade /src/libsystemd/sd-hwdb | |
parent | 9c00a6adfa6c2ded071222b2ec76295480add34e (diff) |
util: introduce safe_fclose() and port everything over to it
Adds a coccinelle script to port things over automatically.
Diffstat (limited to 'src/libsystemd/sd-hwdb')
-rw-r--r-- | src/libsystemd/sd-hwdb/sd-hwdb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c index 06c98314e8..f0316be659 100644 --- a/src/libsystemd/sd-hwdb/sd-hwdb.c +++ b/src/libsystemd/sd-hwdb/sd-hwdb.c @@ -344,8 +344,7 @@ _public_ sd_hwdb *sd_hwdb_unref(sd_hwdb *hwdb) { if (hwdb && REFCNT_DEC(hwdb->n_ref) == 0) { if (hwdb->map) munmap((void *)hwdb->map, hwdb->st.st_size); - if (hwdb->f) - fclose(hwdb->f); + safe_fclose(hwdb->f); free(hwdb->modalias); ordered_hashmap_free(hwdb->properties); free(hwdb); |