Commit d477a9ab by Vicent Martí

Merge pull request #1749 from csware/handle-fixes

Close p->mwf.fd only if necessary
parents cdbcb8dd 3a2d48d5
...@@ -822,7 +822,7 @@ void git_packfile_free(struct git_pack_file *p) ...@@ -822,7 +822,7 @@ void git_packfile_free(struct git_pack_file *p)
git_mwindow_free_all(&p->mwf); git_mwindow_free_all(&p->mwf);
if (p->mwf.fd != -1) if (p->mwf.fd >= 0)
p_close(p->mwf.fd); p_close(p->mwf.fd);
pack_index_free(p); pack_index_free(p);
...@@ -905,6 +905,7 @@ static int packfile_open(struct git_pack_file *p) ...@@ -905,6 +905,7 @@ static int packfile_open(struct git_pack_file *p)
cleanup: cleanup:
giterr_set(GITERR_OS, "Invalid packfile '%s'", p->pack_name); giterr_set(GITERR_OS, "Invalid packfile '%s'", p->pack_name);
if (p->mwf.fd >= 0)
p_close(p->mwf.fd); p_close(p->mwf.fd);
p->mwf.fd = -1; p->mwf.fd = -1;
......
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