]> git.ipfire.org Git - thirdparty/git.git/commit
commit-graph: fix memory leak when `fill_oids_from_packs()` fails
authorLidong Yan <502024330056@smail.nju.edu.cn>
Fri, 9 May 2025 08:30:35 +0000 (08:30 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 May 2025 21:32:40 +0000 (14:32 -0700)
commitbeccbddb6802c0b56e34bb1d55cecceb093940f4
tree69308d66315a12d4e3e1d141b955653764aa0fd3
parent1a8a4971cc6c179c4dd711f4a7f5d7178f4b3ab7
commit-graph: fix memory leak when `fill_oids_from_packs()` fails

In commit-graph.c:fill_oids_from_packs, if open_pack_index failed,
memory allocated and returned by add_packed_git will leak. Simply
add close_pack and free(p) will solve this problem.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c