chiark / gitweb /
networkd: fix use-after-free
[elogind.git] / src / network / networkd-manager.c
index b2cb0fa..ddbdabb 100644 (file)
@@ -145,13 +145,13 @@ void manager_free(Manager *m) {
         sd_event_source_unref(m->sigint_event_source);
         sd_event_unref(m->event);
 
-        while ((network = m->networks))
-                network_free(network);
-
         while ((link = hashmap_first(m->links)))
                 link_free(link);
         hashmap_free(m->links);
 
+        while ((network = m->networks))
+                network_free(network);
+
         while ((netdev = hashmap_first(m->netdevs)))
                 netdev_free(netdev);
         hashmap_free(m->netdevs);