mirror of
https://github.com/systemd/systemd
synced 2024-09-06 00:41:36 +00:00
libudev: also drop the entry from LIST even if unique flag is set
Otherwise, the list becomes dirty when an entry is freed. This also remove the entry from the hashmap only when its name is set. The name should be always set, so that does not change anything. But just for safety.
This commit is contained in:
parent
140716a516
commit
8e5ce38727
|
@ -39,9 +39,10 @@ static struct udev_list_entry *udev_list_entry_free(struct udev_list_entry *entr
|
|||
return NULL;
|
||||
|
||||
if (entry->list) {
|
||||
if (entry->list->unique)
|
||||
if (entry->list->unique && entry->name)
|
||||
hashmap_remove(entry->list->unique_entries, entry->name);
|
||||
else
|
||||
|
||||
if (!entry->list->unique || entry->list->uptodate)
|
||||
LIST_REMOVE(entries, entry->list->entries, entry);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue