Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-10-03 23:29:30 +0300
committerJunio C Hamano <gitster@pobox.com>2023-10-04 00:28:24 +0300
commit09a75abba4eabab3f2cc4474e5d2db3a33a3a682 (patch)
tree4bc938e84531f442535d32f0a69e5d7b5b5f985d /patch-ids.h
parentac6d45d11f24921ead899c74569b717a7895f4a5 (diff)
commit-graph: free all elements of graph chain
When running "commit-graph verify", we call free_commit_graph(). That's sufficient for the case of a single graph file, but if we loaded a chain of split graph files, they form a linked list via the base_graph pointers. We need to free all of them, or we leak all but the first struct. We can make this work by teaching free_commit_graph() to walk the base_graph pointers and free each element. This in turn lets us simplify close_commit_graph(), which does the same thing by recursion (we cannot just use close_commit_graph() in "commit-graph verify", as the function takes a pointer to an object store, and the verify command creates a single one-off graph struct). While indenting the code in free_commit_graph() for the loop, I noticed that setting g->data to NULL is rather pointless, as we free the struct a few lines later. So I cleaned that up while we're here. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'patch-ids.h')
0 files changed, 0 insertions, 0 deletions