diff options
author | Jeff King <peff@peff.net> | 2023-10-03 23:31:30 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-10-04 00:28:24 +0300 |
commit | da09e7af68247519e2b19fc8dff113896c39ac3c (patch) | |
tree | 311325c53668191327192c7cc4cc53e0cdbc97a7 /builtin/commit-graph.c | |
parent | d9c84c6d67e3418bade00af7bcb5f72d7c656164 (diff) |
commit-graph: clear oidset after finishing write
In graph_write() we store commits in an oidset, but never clean it up,
leaking the contents. We should clear it in the cleanup section.
The oidset comes from 6830c36077 (commit-graph.h: replace 'commit_hex'
with 'commits', 2020-04-13), but it was just replacing a string_list
that was also leaked. Curiously, we fixed the leak of some adjacent
variables in commit fa8953cb40 (builtin/commit-graph.c: extract
'read_one_commit()', 2020-05-18), but the oidset wasn't included for
some reason.
In combination with the preceding commits, this lets us mark t5324 as
leak-free.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-graph.c')
-rw-r--r-- | builtin/commit-graph.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index c88389df24..c527a8369e 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -311,6 +311,7 @@ cleanup: FREE_AND_NULL(options); string_list_clear(&pack_indexes, 0); strbuf_release(&buf); + oidset_clear(&commits); return result; } |