chiark / gitweb /
tty-ask-password-agent: return negative errno
[elogind.git] / src / network / networkd-network.c
index 6437ff4230f502a8a4d410971a764bdb5add4068..47fab4ecb043defad9745664413f6c5573ac8c5d 100644 (file)
@@ -20,7 +20,7 @@
 ***/
 
 #include "networkd.h"
-#include "net-util.h"
+#include "network-internal.h"
 #include "path-util.h"
 #include "conf-files.h"
 #include "conf-parser.h"
@@ -69,6 +69,10 @@ static int network_load_one(Manager *manager, const char *filename) {
         if (!network->routes_by_section)
                 return log_oom();
 
+        network->dns = set_new(NULL, NULL);
+        if (!network->dns)
+                return log_oom();
+
         network->filename = strdup(filename);
         if (!network->filename)
                 return log_oom();
@@ -136,6 +140,7 @@ int network_load(Manager *manager) {
 void network_free(Network *network) {
         Route *route;
         Address *address;
+        Iterator i;
 
         if (!network)
                 return;
@@ -150,7 +155,10 @@ void network_free(Network *network) {
 
         free(network->description);
 
-        address_free(network->dns);
+        SET_FOREACH(address, network->dns, i)
+                address_free(address);
+
+        set_free(network->dns);
 
         hashmap_free(network->vlans);
 
@@ -168,6 +176,11 @@ void network_free(Network *network) {
         if (network->manager && network->manager->networks)
                 LIST_REMOVE(networks, network->manager->networks, network);
 
+        condition_free_list(network->match_host);
+        condition_free_list(network->match_virt);
+        condition_free_list(network->match_kernel);
+        condition_free_list(network->match_arch);
+
         free(network);
 }