Re: [PATCH 14/20] builtin/fetch-pack: fix leaking refs
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 21, 2024, 17:46 UTC
- Message-ID
- <xmqq5xrtzs3c.fsf@gitster.g>
- In-Reply-To
- <1c94195488d2db8ba169368a6c28171d5a2640f3.1724159575.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 7 quoted lines
> We build several ref lists in git-fetch-pack(1), but never free them. > Fix those leaks. > > Signed-off-by: Patrick Steinhardt <ps@pks.im> > --- > builtin/fetch-pack.c | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-)
Quite straight-forward. In addition to plugging leaks, the resulting code is much easier to reason about by avoiding the reuse of the variable.