chiark / gitweb /
networkd: fix memory leak in error path
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 3 Jan 2014 00:49:49 +0000 (19:49 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 3 Jan 2014 00:49:49 +0000 (19:49 -0500)
src/network/networkd-network.c

index 9533aff..3cbc9ab 100644 (file)
@@ -24,6 +24,7 @@
 #include "path-util.h"
 #include "conf-files.h"
 #include "conf-parser.h"
+#include "util.h"
 
 static int network_load_one(Manager *manager, const char *filename) {
         _cleanup_network_free_ Network *network = NULL;
@@ -77,7 +78,8 @@ static int network_load_one(Manager *manager, const char *filename) {
 
 int network_load(Manager *manager) {
         Network *network;
-        char **files, **f;
+        _cleanup_strv_free_ char **files = NULL;
+        char **f;
         int r;
 
         assert(manager);
@@ -97,8 +99,6 @@ int network_load(Manager *manager) {
                         return r;
         }
 
-        strv_free(files);
-
         return 0;
 }