summaryrefslogtreecommitdiff
path: root/commit-reach.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-05-30 08:54:58 -0700
committerJunio C Hamano <gitster@pobox.com>2024-05-30 08:54:58 -0700
commita3f0e2a06496c8547b27921445ab47f482452a69 (patch)
tree3fad1f1ce36df7d8328a1a3c43a4dd41e37526a8 /commit-reach.c
parent3a57aa566a21e7a510c64881bc6bdff7eb397988 (diff)
parentebdbefa4fe9f618347124b37d44e517e0c6a3e4c (diff)
Merge branch 'ps/leakfixes' into jk/leakfixes
* ps/leakfixes: builtin/mv: fix leaks for submodule gitfile paths builtin/mv: refactor to use `struct strvec` builtin/mv duplicate string list memory builtin/mv: refactor `add_slash()` to always return allocated strings strvec: add functions to replace and remove strings submodule: fix leaking memory for submodule entries commit-reach: fix memory leak in `ahead_behind()` builtin/credential: clear credential before exit config: plug various memory leaks config: clarify memory ownership in `git_config_string()` builtin/log: stop using globals for format config builtin/log: stop using globals for log config convert: refactor code to clarify ownership of check_roundtrip_encoding diff: refactor code to clarify memory ownership of prefixes config: clarify memory ownership in `git_config_pathname()` http: refactor code to clarify memory ownership checkout: clarify memory ownership in `unique_tracking_name()` strbuf: fix leak when `appendwholeline()` fails with EOF transport-helper: fix leaking helper name
Diffstat (limited to 'commit-reach.c')
-rw-r--r--commit-reach.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/commit-reach.c b/commit-reach.c
index 8f9b008f87..384aee1ab3 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -1106,6 +1106,10 @@ void ahead_behind(struct repository *r,
/* STALE is used here, PARENT2 is used by insert_no_dup(). */
repo_clear_commit_marks(r, PARENT2 | STALE);
+ while (prio_queue_peek(&queue)) {
+ struct commit *c = prio_queue_get(&queue);
+ free_bit_array(c);
+ }
clear_bit_arrays(&bit_arrays);
clear_prio_queue(&queue);
}