Re: [PATCH v2] fill_oids_from_packs: fix memory leak when fill_oids_from_packs failed
- From
Patrick Steinhardt <ps@pks.im>
- Date
- May 9, 2025, 08:25 UTC
- Message-ID
- <aB2765DnIjb1xDQW@pks.im>
- In-Reply-To
- <pull.1957.v2.git.git.1746774869081.gitgitgadget@gmail.com>
On Fri, May 09, 2025 at 07:14:28AM +0000, Lidong Yan via GitGitGadget wrote:
Show 5 quoted lines
> From: Lidong Yan <502024330056@smail.nju.edu.cn> > > 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.
One more thing that I missed in the first review: the commit subject should mention the subsystem as prefix, not the specific function. So It should e.g. read:
commit-grap: fix memory leak when `fill_oids_from_packs()` fails
Patrick