aboutsummaryrefslogtreecommitdiff
path: root/tests/fuzz/fuzzer.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-06-14 12:48:47 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2020-06-14 12:54:13 +0000
commitc4df8b1390da6b59f9d410a10905b2face807b00 (patch)
tree223386b1ffc3e4a9fc6b66b1b291a6a0d20f4be1 /tests/fuzz/fuzzer.h
parentfuzz_tests: add a tx extra fuzz test (diff)
downloadmonero-c4df8b1390da6b59f9d410a10905b2face807b00.tar.xz
fix leaks in fuzz tests
Diffstat (limited to 'tests/fuzz/fuzzer.h')
-rw-r--r--tests/fuzz/fuzzer.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/fuzz/fuzzer.h b/tests/fuzz/fuzzer.h
index 2d0a29dfc..fac7e474a 100644
--- a/tests/fuzz/fuzzer.h
+++ b/tests/fuzz/fuzzer.h
@@ -66,8 +66,12 @@ extern "C" { \
catch (const std::exception &e) \
{ \
fprintf(stderr, "Exception: %s\n", e.what()); \
- return 1; \
+ delete el::base::elStorage; \
+ el::base::elStorage = NULL; \
+ return 0; \
} \
+ delete el::base::elStorage; \
+ el::base::elStorage = NULL; \
return 0; \
} \
}
@@ -122,8 +126,12 @@ int run_fuzzer(int argc, const char **argv, Fuzzer &fuzzer);
catch (const std::exception &e) \
{ \
fprintf(stderr, "Exception: %s\n", e.what()); \
- return 1; \
+ delete el::base::elStorage; \
+ el::base::elStorage = NULL; \
+ return 0; \
} \
+ delete el::base::elStorage; \
+ el::base::elStorage = NULL; \
return 0; \
} \
}; \