]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: fix memleak 5085/head
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 6396a69c5c402bf9639c0e8b031d97a4272ee761..78ae2f4a0fefa9614f9631c7aa4913de3e4eecbf 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;