diff options
| author | Junio C Hamano <gitster@pobox.com> | 2026-03-03 11:08:12 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-03 11:08:12 -0800 |
| commit | d455602a4d43be6117a7fc45c4729e24b4ed6903 (patch) | |
| tree | 0f6580a1bf8855da5d880b7b4c9ff30191dc472e | |
| parent | 2f9980cfebad39326546e4db1f614bdaf783f51b (diff) | |
| parent | 7451864bfac0fc7ac829aceecd7f339b80dac732 (diff) | |
| download | git-d455602a4d43be6117a7fc45c4729e24b4ed6903.tar.xz | |
Merge branch 'sc/pack-redundant-leakfix'
Leakfix.
* sc/pack-redundant-leakfix:
pack-redundant: fix memory leak when open_pack_index() fails
| -rw-r--r-- | builtin/pack-redundant.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c index e4ecf774ca..86749bb7e7 100644 --- a/builtin/pack-redundant.c +++ b/builtin/pack-redundant.c @@ -546,8 +546,10 @@ static struct pack_list * add_pack(struct packed_git *p) l.pack = p; llist_init(&l.remaining_objects); - if (open_pack_index(p)) + if (open_pack_index(p)) { + llist_free(l.remaining_objects); return NULL; + } base = p->index_data; base += 256 * 4 + ((p->index_version < 2) ? 4 : 8); |
