Re: [PATCH v6 19/19] push: free_refs() the "local_refs" in set_refspecs()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 2, 2023, 22:12 UTC
- Message-ID
- <xmqqfsbnson8.fsf@gitster.g>
- In-Reply-To
- <patch-v6-19.19-67076dfba6d-20230202T094704Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 10 quoted lines
> Fix a memory leak that's been with us since this code was added in > ca02465b413 (push: use remote.$name.push as a refmap, 2013-12-03). > > The "remote = remote_get(...)" added in the same commit would seem to > leak based only on the context here, but that function is a wrapper > for sticking the remotes we fetch into "the_repository->remote_state". > > See fd3cb0501e1 (remote: move static variables into per-repository > struct, 2021-11-17) for the addition of code in repository.c that > free's the "remote" allocated here.
As I noted in my review of the previous step, the "if !local_heads" change we saw in the previous step goes better in this step, whose focus is on fixing the local_refs leak.