summary refs log tree commit diff
path: root/fuzz-commit-graph.c
diff options
context:
space:
mode:
authorJosh Steadmon <steadmon@google.com>2020-06-05 15:55:14 -0700
committerJunio C Hamano <gitster@pobox.com>2020-06-08 10:02:29 -0700
commit104de88675a16729ec317b87df045919e611d218 (patch)
tree4e8915b1e3ec000d2a57a2562bc7aa2d4f3d0f16 /fuzz-commit-graph.c
parentc8828530b7797f5ab584c84dc2b86d3c14b39c8d (diff)
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>
Diffstat (limited to 'fuzz-commit-graph.c')
-rw-r--r--fuzz-commit-graph.c2
1 files changed, 1 insertions, 1 deletions
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;
 }