fuzz-commit-graph: properly free graph struct
authorJosh Steadmon <redacted>
Fri, 5 Jun 2020 22:55:14 +0000 (15:55 -0700)
committerJunio C Hamano <redacted>
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 <redacted>
Reviewed-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
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;
 }
git clone https://git.99rst.org/PROJECT