X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Flibudev%2Flibudev-hwdb.c;h=8fe24a432001b7d2ed91d1120c27de867dbe0aee;hp=92c58b61a2594a9592620ca496e655e4fd6057a5;hb=9485d98d7741604c3d728edaed60b02ad63b71df;hpb=2001208c2ab631a69896d1f670c26846b70d1fb7;ds=inline diff --git a/src/libudev/libudev-hwdb.c b/src/libudev/libudev-hwdb.c index 92c58b61a..8fe24a432 100644 --- a/src/libudev/libudev-hwdb.c +++ b/src/libudev/libudev-hwdb.c @@ -35,7 +35,7 @@ * SECTION:libudev-hwdb * @short_description: retrieve properties from the hardware database * - * Libuded hardware database interface. + * Libudev hardware database interface. */ /** @@ -338,10 +338,10 @@ _public_ struct udev_hwdb *udev_hwdb_unref(struct udev_hwdb *hwdb) { hwdb->refcount--; if (hwdb->refcount > 0) return hwdb; - if (hwdb->f) - fclose(hwdb->f); if (hwdb->map) munmap((void *)hwdb->map, hwdb->st.st_size); + if (hwdb->f) + fclose(hwdb->f); udev_list_cleanup(&hwdb->properties_list); free(hwdb); return NULL; @@ -382,6 +382,7 @@ _public_ struct udev_list_entry *udev_hwdb_get_properties_list_entry(struct udev return NULL; } + udev_list_cleanup(&hwdb->properties_list); err = trie_search_f(hwdb, modalias); if (err < 0) { errno = -err;