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>
This commit is contained in:
Josh Steadmon 2020-06-05 15:55:14 -07:00 коммит произвёл Junio C Hamano
Родитель c8828530b7
Коммит 104de88675
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -12,7 +12,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
initialize_the_repository(); initialize_the_repository();
g = parse_commit_graph((void *)data, size); g = parse_commit_graph((void *)data, size);
repo_clear(the_repository); repo_clear(the_repository);
free(g); free_commit_graph(g);
return 0; return 0;
} }