]> git.ipfire.org Git - thirdparty/git.git/commit
remote: fix leaking tracking refs
authorPatrick Steinhardt <ps@pks.im>
Thu, 5 Sep 2024 10:08:59 +0000 (12:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Sep 2024 15:49:11 +0000 (08:49 -0700)
commitcdbb7208c80661754b3f1a73aef086c08f88dcff
tree941ad6539e02a975500e7cc3cabb1fc142d9e32f
parent1e8cb17ac5c0e7871e15dd40bacd617f25a54763
remote: fix leaking tracking refs

When computing the remote tracking ref we cause two memory leaks:

  - We leak when `remote_tracking()` fails.

  - We leak when the call to `remote_tracking()` succeeds and sets
    `ref->tracking_ref()`.

Fix both of these leaks.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c