about summary refs log tree commit diff
path: root/custom_mutators/libfuzzer/libfuzzer.cpp
diff options
context:
space:
mode:
authorhexcoder- <heiko@hexco.de>2020-11-12 20:26:53 +0100
committerhexcoder- <heiko@hexco.de>2020-11-12 20:26:53 +0100
commitffe41e6fcec3e6228770c8fe11ec67b8cfb4878c (patch)
treefeb18f03815780221f9f98c7ecc77f9070ff6561 /custom_mutators/libfuzzer/libfuzzer.cpp
parent14e76cf3c9059e59c8df82a9d24f0ec81e75aeea (diff)
downloadafl++-ffe41e6fcec3e6228770c8fe11ec67b8cfb4878c.tar.gz
fix two mem leaks detected by cppcheck
Diffstat (limited to 'custom_mutators/libfuzzer/libfuzzer.cpp')
-rw-r--r--custom_mutators/libfuzzer/libfuzzer.cpp1
1 files changed, 1 insertions, 0 deletions
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;