mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-20 22:08:41 +00:00
Merge pull request #1755 from csware/double-close
Fix possible double close
This commit is contained in:
commit
94d12ffab7
@ -222,6 +222,7 @@ int git_futils_writebuffer(
|
|||||||
if ((error = p_write(fd, git_buf_cstr(buf), git_buf_len(buf))) < 0) {
|
if ((error = p_write(fd, git_buf_cstr(buf), git_buf_len(buf))) < 0) {
|
||||||
giterr_set(GITERR_OS, "Could not write to '%s'", path);
|
giterr_set(GITERR_OS, "Could not write to '%s'", path);
|
||||||
(void)p_close(fd);
|
(void)p_close(fd);
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((error = p_close(fd)) < 0)
|
if ((error = p_close(fd)) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user