nspawn: fix memleak
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 15 Jan 2017 21:57:57 +0000 (16:57 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 15 Jan 2017 21:57:57 +0000 (16:57 -0500)
CID #1368262: fn is allocated with new, so it should be freed.

src/nspawn/nspawn.c

index 6396a69..78ae2f4 100644 (file)
@@ -3470,8 +3470,8 @@ static int run(int master,
 }
 
 static int load_root_hash(const char *image) {
-        _cleanup_free_ char *text = NULL;
-        char *fn, *n, *e;
+        _cleanup_free_ char *text = NULL, *fn = NULL;
+        char *n, *e;
         void *k;
         size_t l;
         int r;