From ffe41e6fcec3e6228770c8fe11ec67b8cfb4878c Mon Sep 17 00:00:00 2001 From: hexcoder- Date: Thu, 12 Nov 2020 20:26:53 +0100 Subject: fix two mem leaks detected by cppcheck --- custom_mutators/libfuzzer/libfuzzer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'custom_mutators/libfuzzer') diff --git a/custom_mutators/libfuzzer/libfuzzer.cpp b/custom_mutators/libfuzzer/libfuzzer.cpp index a4f94328..dc1fbeb2 100644 --- a/custom_mutators/libfuzzer/libfuzzer.cpp +++ b/custom_mutators/libfuzzer/libfuzzer.cpp @@ -50,6 +50,7 @@ extern "C" my_mutator_t *afl_custom_init(afl_state_t *afl, unsigned int seed) { if ((data->mutator_buf = (u8 *)malloc(MAX_FILE)) == NULL) { + free(data); perror("mutator_buf alloc"); return NULL; -- cgit 1.4.1