Skip to content

Commit d9c84c6

Browse files
peffgitster
authored andcommitted
commit-graph: free write-context base_graph_name during cleanup
Commit 6c622f9 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 274bfa7 commit d9c84c6

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

commit-graph.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,6 +2518,7 @@ int write_commit_graph(struct object_directory *odb,
25182518

25192519
cleanup:
25202520
free(ctx->graph_name);
2521+
free(ctx->base_graph_name);
25212522
free(ctx->commits.list);
25222523
oid_array_clear(&ctx->oids);
25232524
clear_topo_level_slab(&topo_levels);

t/t5328-commit-graph-64bit-time.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

33
test_description='commit graph with 64-bit timestamps'
4+
5+
TEST_PASSES_SANITIZE_LEAK=true
46
. ./test-lib.sh
57

68
if ! test_have_prereq TIME_IS_64BIT || ! test_have_prereq TIME_T_IS_64BIT

0 commit comments

Comments
 (0)