Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit-graph: fix memory leak
author
Josh Steadmon
<steadmon@google.com>
Mon, 6 May 2019 21:36:58 +0000
(14:36 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 7 May 2019 04:49:28 +0000
(13:49 +0900)
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>
commit-graph.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
83232e3
)
diff --git
a/commit-graph.c
b/commit-graph.c
index 66865acbd7489df4f85ee2454fe05a9b346e7aa7..4bce70d35c9baaa5504c7a15d8208d7ffc185df8 100644
(file)
--- 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;
}