Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Steadmon <steadmon@google.com>2019-05-07 00:36:58 +0300
committerJunio C Hamano <gitster@pobox.com>2019-05-07 07:49:28 +0300
commit98552f252ad4a86573d75665fc403f5e66056bb2 (patch)
tree0b9ee24c30740e1f155fd496d3b15be87a414ae9 /commit-graph.c
parent83232e38648b51abbcbdb56c94632b6906cc85a6 (diff)
commit-graph: fix memory leak
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>
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 66865acbd7..4bce70d35c 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -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;
}