[lxc-devel] [PATCH] close the fd on error
S.Çağlar Onur
caglar at 10ur.org
Sat Jan 25 05:46:04 UTC 2014
Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
---
src/lxc/lxccontainer.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
index fbf0824..6ea7c11 100644
--- a/src/lxc/lxccontainer.c
+++ b/src/lxc/lxccontainer.c
@@ -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;
}
--
1.8.3.2
More information about the lxc-devel
mailing list