tools: fix unitialized variable

Closes #2242.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
Christian Brauner 2018-03-29 18:20:35 +02:00
parent 5b66b6ee3e
commit 9104c79a1d
No known key found for this signature in database
GPG Key ID: 8EB056D53EECB12D

View File

@ -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);