summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-02-02 02:34:20 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-02-02 02:34:23 +0900
commit65c637ad2c2dc1fcddac01f104cdb146a88af852 (patch)
tree488ee7bc00d0ff4c9ba1e900f2eb25e926935bb3
parent8e5ce38727246a213d88f43da72ae2769d99d3f6 (diff)
downloadsystemd-65c637ad2c2dc1fcddac01f104cdb146a88af852.tar.gz
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.
-rw-r--r--src/libudev/libudev-list.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev-list.c b/src/libudev/libudev-list.c
index d42008e48d..d992d1879b 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);