Free the commit graph when verify_commit_graph_lite() reports an error.
Credit to OSS-Fuzz for finding this leak.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Josh Steadmon 2019-05-06 14:36:58 -07:00 коммит произвёл Junio C Hamano
Родитель 83232e3864
Коммит 98552f252a
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -267,8 +267,10 @@ struct commit_graph *parse_commit_graph(void *graph_map, int fd,
last_chunk_offset = chunk_offset;
}
if (verify_commit_graph_lite(graph))
if (verify_commit_graph_lite(graph)) {
free(graph);
return NULL;
}
return graph;
}