@matheusbsbs / matheus-bagliano / commits / 104de88675
Fork 0

fuzz-commit-graph: properly free graph struct

Use the provided free_commit_graph() to properly free the commit graph in fuzz-commit-graph. Otherwise, the fuzzer itself leaks memory when the struct contains pointers to allocated memory. Signed-off-by: Josh Steadmon <steadmon@google.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Josh Steadmon committed Jun 5, 2020 at 15:55 UTC 104de88675a16729ec317b87df045919e611d218
1 file changed +1 -1
fuzz-commit-graph.c
+1 -1
@@ -12,7 +12,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
12 initialize_the_repository();
13 g = parse_commit_graph((void *)data, size);
14 repo_clear(the_repository);
15 - free(g);
15 + free_commit_graph(g);
16
17 return 0;
18 }