mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 08:12:42 +00:00
Merge pull request #1101 from csware/prevent_die
pack.c: Set p->mwf.fd to -1 on error
This commit is contained in:
commit
8404f2d67f
@ -564,8 +564,10 @@ static int packfile_open(struct git_pack_file *p)
|
|||||||
|
|
||||||
/* TODO: open with noatime */
|
/* TODO: open with noatime */
|
||||||
p->mwf.fd = git_futils_open_ro(p->pack_name);
|
p->mwf.fd = git_futils_open_ro(p->pack_name);
|
||||||
if (p->mwf.fd < 0)
|
if (p->mwf.fd < 0) {
|
||||||
return p->mwf.fd;
|
p->mwf.fd = -1;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (p_fstat(p->mwf.fd, &st) < 0 ||
|
if (p_fstat(p->mwf.fd, &st) < 0 ||
|
||||||
git_mwindow_file_register(&p->mwf) < 0)
|
git_mwindow_file_register(&p->mwf) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user