Skip to content

Commit

Permalink
close the fd on error
Browse files Browse the repository at this point in the history
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
caglar10ur authored and stgraber committed Jan 25, 2014
1 parent 0bc8db6 commit a684f0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lxc/lxccontainer.c
Expand Up @@ -2486,8 +2486,10 @@ static int clone_update_rootfs(struct clone_update_data *data)
SYSERROR("unable to open %s: ignoring\n", path);
return 0;
}
if (fprintf(fout, "%s", c->name) < 0)
if (fprintf(fout, "%s", c->name) < 0) {
fclose(fout);
return -1;
}
if (fclose(fout) < 0)
return -1;
}
Expand Down

0 comments on commit a684f0b

Please sign in to comment.