]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fuzz-commit-graph: properly free graph struct
authorJosh Steadmon <steadmon@google.com>
Fri, 5 Jun 2020 22:55:14 +0000 (15:55 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Jun 2020 17:02:29 +0000 (10:02 -0700)
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>
fuzz-commit-graph.c

index 9fd1c04edd3108917ebae6e83840e1a2383606a9..430817214dcbfaadb35a3505b84a9dafa45865c8 100644 (file)
@@ -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;
 }