git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fuzz-commit-graph: properly free graph struct
@ 2020-06-05 22:55 Josh Steadmon
  2020-06-05 23:02 ` Jonathan Nieder
  0 siblings, 1 reply; 3+ messages in thread
From: Josh Steadmon @ 2020-06-05 22:55 UTC (permalink / raw)
  To: git

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>
---
 fuzz-commit-graph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 
 	return 0;
 }
-- 
2.27.0.278.ge193c7cf3a9-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-05 23:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-05 22:55 [PATCH] fuzz-commit-graph: properly free graph struct Josh Steadmon
2020-06-05 23:02 ` Jonathan Nieder
2020-06-05 23:30   ` Josh Steadmon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).