Thread (3 messages) flat view 3 messages, 2 authors, 2020-06-05

Re: [PATCH] fuzz-commit-graph: properly free graph struct

From: Jonathan Nieder <hidden>
Date: 2020-06-05 23:02:38

Josh Steadmon wrote:
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>
---
 fuzz-commit-graph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
How can I reproduce this?
quoted hunk ↗ jump to hunk
diff --git a/fuzz-commit-graph.c b/fuzz-commit-graph.c
index 9fd1c04edd..430817214d 100644
--- a/fuzz-commit-graph.c
+++ b/fuzz-commit-graph.c
@@ -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);
In any event, the patch itself is sensible, so
Reviewed-by: Jonathan Nieder <redacted>

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help