From: Josh Steadmon Date: Fri, 5 Jun 2020 22:55:14 +0000 (-0700) Subject: fuzz-commit-graph: properly free graph struct X-Git-Tag: v2.28.0-rc0~54^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=104de88675a16729ec317b87df045919e611d218;p=thirdparty%2Fgit.git 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 Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- diff --git a/fuzz-commit-graph.c b/fuzz-commit-graph.c index 9fd1c04edd..430817214d 100644 --- a/fuzz-commit-graph.c +++ b/fuzz-commit-graph.c @@ -12,7 +12,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) initialize_the_repository(); g = parse_commit_graph((void *)data, size); repo_clear(the_repository); - free(g); + free_commit_graph(g); return 0; }