commit-graph: free write-context base_graph_name during cleanup

Commit 6c622f9f0b (commit-graph: write commit-graph chains, 2019-06-18) added a base_graph_name string to the write_commit_graph_context struct. But the end-of-function cleanup forgot to free it, causing a leak. This (presumably in combination with the preceding leak-fixes) lets us mark t5328 as leak-free. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 3, 2023 at 16:31 UTC d9c84c6d67e3418bade00af7bcb5f72d7c656164
2 files changed +3
commit-graph.c
+1
@@ -2518,6 +2518,7 @@ int write_commit_graph(struct object_directory *odb,
2518
2519 cleanup:
2520 free(ctx->graph_name);
2521 + free(ctx->base_graph_name);
2522 free(ctx->commits.list);
2523 oid_array_clear(&ctx->oids);
2524 clear_topo_level_slab(&topo_levels);
t/t5328-commit-graph-64bit-time.sh
+2
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 test_description='commit graph with 64-bit timestamps'
4 +
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 if ! test_have_prereq TIME_IS_64BIT || ! test_have_prereq TIME_T_IS_64BIT