tools: fix unitialized variable

Closes #2242. Signed-off-by: 's avatarChristian Brauner <christian.brauner@ubuntu.com>
parent 5b66b6ee
...@@ -745,7 +745,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname, ...@@ -745,7 +745,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
int ret, fd; int ret, fd;
size_t len; size_t len;
char *premount = NULL; char *premount = NULL;
FILE *fp; FILE *fp = NULL;
if (arg->tmpfs && arg->keepdata) { if (arg->tmpfs && arg->keepdata) {
fprintf(stderr, "%s\n", fprintf(stderr, "%s\n",
...@@ -810,7 +810,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname, ...@@ -810,7 +810,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
err_close: err_close:
if (fd > 0) if (fd > 0)
close(fd); close(fd);
else else if (fp)
fclose(fp); fclose(fp);
err_free: err_free:
free(premount); free(premount);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment