chiark / gitweb /
nspawn: fix memleak introduced with automatic cleanup
[elogind.git] / src / nspawn / nspawn.c
index b494045b8853212a188f9d5ba25ca25aa93ccd75..ab7a239ed59f7d7df91425a675e4a2feaa195722 100644 (file)
@@ -284,9 +284,9 @@ static int mount_all(const char *dest) {
 
         unsigned k;
         int r = 0;
-        char _cleanup_free_ *where = NULL;
 
         for (k = 0; k < ELEMENTSOF(mount_table); k++) {
+                char _cleanup_free_ *where = NULL;
                 int t;
 
                 if (asprintf(&where, "%s/%s", dest, mount_table[k].where) < 0) {