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,
int ret, fd;
size_t len;
char *premount = NULL;
FILE *fp;
FILE *fp = NULL;
if (arg->tmpfs && arg->keepdata) {
fprintf(stderr, "%s\n",
......@@ -810,7 +810,7 @@ static char *mount_tmpfs(const char *oldname, const char *newname,
err_close:
if (fd > 0)
close(fd);
else
else if (fp)
fclose(fp);
err_free:
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