mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-28 08:04:35 +00:00
Close p->mwf.fd only if necessary
This fixes a regression introduced in revision 9d2f841a5d
.
Signed-off-by: Sven Strickroth <email@cs-ware.de>
This commit is contained in:
parent
cdbcb8dd80
commit
3a2d48d5ee
@ -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,7 +905,8 @@ 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);
|
||||||
|
|
||||||
p_close(p->mwf.fd);
|
if (p->mwf.fd >= 0)
|
||||||
|
p_close(p->mwf.fd);
|
||||||
p->mwf.fd = -1;
|
p->mwf.fd = -1;
|
||||||
|
|
||||||
git_mutex_unlock(&p->lock);
|
git_mutex_unlock(&p->lock);
|
||||||
|
Loading…
Reference in New Issue
Block a user