Commit 638c6b8c by Patrick Steinhardt

odb_loose: only close file descriptor if it was opened successfully

parent a43bcd2c
...@@ -433,7 +433,8 @@ static int read_header_loose(git_rawobj *out, git_buf *loc) ...@@ -433,7 +433,8 @@ static int read_header_loose(git_rawobj *out, git_buf *loc)
} }
done: done:
p_close(fd); if (fd >= 0)
p_close(fd);
return error; return error;
} }
......
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