Commit 036be150 by Edward Thomson

hashsig: close fd on error

parent 9191ef70
...@@ -286,8 +286,10 @@ int git_hashsig_create_fromfile( ...@@ -286,8 +286,10 @@ int git_hashsig_create_fromfile(
return fd; return fd;
} }
if ((error = hashsig_in_progress_init(&prog, sig)) < 0) if ((error = hashsig_in_progress_init(&prog, sig)) < 0) {
p_close(fd);
return error; return error;
}
while (!error) { while (!error) {
if ((buflen = p_read(fd, buf, sizeof(buf))) <= 0) { if ((buflen = p_read(fd, buf, sizeof(buf))) <= 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment