nspawn: fix memleak introduced with automatic cleanup

6b2d0e8 introduced a memleak instead of fixing one.
Fix both.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2012-09-16 16:33:20 +02:00
parent 25ea79fe07
commit 89154bd4ac

View 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) {