]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/libudev/libudev-list.c
libudev: set entry->list after the entry is stored in the list
[thirdparty/systemd.git] / src / libudev / libudev-list.c
index 514927bc8fa53262f4c02287f10de445bdd94963..c224e9df6d3232860c714e922ba4a79320bdd116 100644 (file)
@@ -88,7 +88,6 @@ struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *
                 return NULL;
 
         *entry = (struct udev_list_entry) {
-                .list = list,
                 .name = TAKE_PTR(name),
                 .value = TAKE_PTR(value),
         };
@@ -103,6 +102,8 @@ struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *
         } else
                 LIST_APPEND(entries, list->entries, entry);
 
+        entry->list = list;
+
         return TAKE_PTR(entry);
 }