]> git.ipfire.org Git - thirdparty/git.git/commit
push: free_refs() the "local_refs" in set_refspecs()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 6 Feb 2023 23:07:54 +0000 (00:07 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 6 Feb 2023 23:34:40 +0000 (15:34 -0800)
commitc65d18cb5259079f44c055c07bf46c13c75780c1
tree6d777b1acb9305083e241b8613932a0d05015ae3
parentaa561208d9d41d757ede1fb40d3ae2c164a21f97
push: free_refs() the "local_refs" in set_refspecs()

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.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 files changed:
builtin/push.c
t/t1416-ref-transaction-hooks.sh
t/t2402-worktree-list.sh
t/t5504-fetch-receive-strict.sh
t/t5523-push-upstream.sh
t/t5529-push-errors.sh
t/t5546-receive-limits.sh
t/t5547-push-quarantine.sh
t/t5606-clone-options.sh
t/t5810-proto-disable-local.sh
t/t5813-proto-disable-ssh.sh
t/t7409-submodule-detached-work-tree.sh
t/t7416-submodule-dash-url.sh
t/t7450-bad-git-dotfiles.sh