From: Yu Watanabe Date: Mon, 1 Feb 2021 17:34:20 +0000 (+0900) Subject: libudev: unset uptodate flag before free()ing entries X-Git-Tag: v248-rc1~224^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=65c637ad2c2dc1fcddac01f104cdb146a88af852;p=thirdparty%2Fsystemd.git libudev: unset uptodate flag before free()ing entries udev_list_entry_free() also removes the entry from LIST if the flag is set. This slightly optimizes the cleanup logic. --- diff --git a/src/libudev/libudev-list.c b/src/libudev/libudev-list.c index d42008e48d6..d992d1879bf 100644 --- a/src/libudev/libudev-list.c +++ b/src/libudev/libudev-list.c @@ -115,8 +115,8 @@ void udev_list_cleanup(struct udev_list *list) { return; if (list->unique) { - hashmap_clear_with_destructor(list->unique_entries, udev_list_entry_free); list->uptodate = false; + hashmap_clear_with_destructor(list->unique_entries, udev_list_entry_free); } else LIST_FOREACH_SAFE(entries, i, n, list->entries) udev_list_entry_free(i);