mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-05 15:33:51 +00:00
pack: fix memory leak in error path
This commit is contained in:
parent
8d6ef4bf78
commit
050af8bbe0
@ -505,8 +505,10 @@ static git_pobject **compute_write_order(git_packbuilder *pb)
|
||||
/*
|
||||
* Mark objects that are at the tip of tags.
|
||||
*/
|
||||
if (git_tag_foreach(pb->repo, &cb_tag_foreach, pb) < 0)
|
||||
if (git_tag_foreach(pb->repo, &cb_tag_foreach, pb) < 0) {
|
||||
git__free(wo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Give the objects in the original recency order until
|
||||
|
@ -329,8 +329,10 @@ static int pack_index_open(struct git_pack_file *p)
|
||||
memcpy(idx_name, p->pack_name, base_len);
|
||||
memcpy(idx_name + base_len, ".idx", sizeof(".idx"));
|
||||
|
||||
if ((error = git_mutex_lock(&p->lock)) < 0)
|
||||
if ((error = git_mutex_lock(&p->lock)) < 0) {
|
||||
git__free(idx_name);
|
||||
return error;
|
||||
}
|
||||
|
||||
if (p->index_version == -1)
|
||||
error = pack_index_check(idx_name, p);
|
||||
|
Loading…
Reference in New Issue
Block a user