Skip to content

Commit

Permalink
tools: fix unitialized variable
Browse files Browse the repository at this point in the history
Closes lxc#2242.

Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
Christian Brauner committed Mar 29, 2018
1 parent 5b66b6e commit 9104c79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lxc/tools/lxc_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9104c79

Please sign in to comment.