summaryrefslogtreecommitdiffstats
path: root/negotiator/skipping.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-09-20 20:16:30 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-20 20:16:30 +0200
commit16c0906e8cd9b32b95dfe68058bcdaad3e4458e4 (patch)
tree5eb2fce820151a347514e6a60c9162c10184256e /negotiator/skipping.c
parentMerge branch 'pw/rebase-autostash-fix' (diff)
parentbuiltin/repack: fix leaking keep-pack list (diff)
downloadgit-16c0906e8cd9b32b95dfe68058bcdaad3e4458e4.tar.xz
git-16c0906e8cd9b32b95dfe68058bcdaad3e4458e4.zip
Merge branch 'ps/leakfixes-part-6'
More leakfixes. * ps/leakfixes-part-6: (22 commits) builtin/repack: fix leaking keep-pack list merge-ort: fix two leaks when handling directory rename modifications match-trees: fix leaking prefixes in `shift_tree()` builtin/fmt-merge-msg: fix leaking buffers builtin/grep: fix leaking object context builtin/pack-objects: plug leaking list of keep-packs builtin/repack: fix leaking line buffer when packing promisors negotiator/skipping: fix leaking commit entries shallow: fix leaking members of `struct shallow_info` shallow: free grafts when unregistering them object: clear grafts when clearing parsed object pool gpg-interface: fix misdesigned signing key interfaces send-pack: fix leaking push cert nonce remote: fix leak in reachability check of a remote-tracking ref remote: fix leaking tracking refs builtin/submodule--helper: fix leaking refs on push-check submodule: fix leaking fetch task data upload-pack: fix leaking child process data on reachability checks builtin/push: fix leaking refspec query result send-pack: fix leaking common object IDs ...
Diffstat (limited to 'negotiator/skipping.c')
-rw-r--r--negotiator/skipping.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/negotiator/skipping.c b/negotiator/skipping.c
index 6e61b3c5f1..abedb70a48 100644
--- a/negotiator/skipping.c
+++ b/negotiator/skipping.c
@@ -247,8 +247,11 @@ static int ack(struct fetch_negotiator *n, struct commit *c)
static void release(struct fetch_negotiator *n)
{
- clear_prio_queue(&((struct data *)n->data)->rev_list);
- FREE_AND_NULL(n->data);
+ struct data *data = n->data;
+ for (int i = 0; i < data->rev_list.nr; i++)
+ free(data->rev_list.array[i].data);
+ clear_prio_queue(&data->rev_list);
+ FREE_AND_NULL(data);
}
void skipping_negotiator_init(struct fetch_negotiator *negotiator)