diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c index 0ab06ac3b9..9d56b40700 100644 --- a/src/mount/mount-tool.c +++ b/src/mount/mount-tool.c @@ -736,13 +736,13 @@ static int find_mount_points(const char *what, char ***list) { if (!GREEDY_REALLOC(l, bufsize, n + 2)) return log_oom(); - l[n] = strdup(where); - if (!l[n]) - return log_oom(); - - n++; + l[n++] = where; + where = NULL; } + if (!GREEDY_REALLOC(l, bufsize, n + 1)) + return log_oom(); + l[n] = NULL; *list = l; l = NULL; /* avoid freeing */