summaryrefslogtreecommitdiff
path: root/src/fileops.c
diff options
context:
space:
mode:
authorSven Strickroth <email@cs-ware.de>2013-07-27 20:15:06 +0200
committerSven Strickroth <email@cs-ware.de>2013-07-27 20:15:06 +0200
commitf5254d78441f7fa1067a1c34d3925b72afcb024c (patch)
treecf6ea5883e3a94a12f95339d9fee2c79ce8a78bd /src/fileops.c
parentd477a9ab7e007cb31f51241861f9e434419b9621 (diff)
downloadlibgit2-f5254d78441f7fa1067a1c34d3925b72afcb024c.tar.gz
Fix possible double close
Signed-off-by: Sven Strickroth <email@cs-ware.de>
Diffstat (limited to 'src/fileops.c')
-rw-r--r--src/fileops.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/fileops.c b/src/fileops.c
index c01ff64db..7f8418d7a 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -222,6 +222,7 @@ int git_futils_writebuffer(
if ((error = p_write(fd, git_buf_cstr(buf), git_buf_len(buf))) < 0) {
giterr_set(GITERR_OS, "Could not write to '%s'", path);
(void)p_close(fd);
+ return error;
}
if ((error = p_close(fd)) < 0)