chiark / gitweb /
Fix a few return codes in error paths
[elogind.git] / src / network / networkd-network.c
index 6e9915b75dabb2834ffbed4b14dd97fa4b4656f4..bdf71e854e2484b6ed5ffa859880d972683ae97f 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"
@@ -41,7 +41,7 @@ static int network_load_one(Manager *manager, const char *filename) {
                 if (errno == ENOENT)
                         return 0;
                 else
-                        return errno;
+                        return -errno;
         }
 
         network = new0(Network, 1);
@@ -176,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);
 }