diff options
author | luigi1111 <luigi1111w@gmail.com> | 2020-06-19 10:17:51 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2020-06-19 10:17:51 -0500 |
commit | 93257997bd69e25c76de8ebf3f46bfeb44f11589 (patch) | |
tree | 1b9cf72c5a4911ca7ba449353a080be431a17c45 /tests/fuzz/fuzzer.h | |
parent | Merge pull request #6637 (diff) | |
parent | fuzz_tests: fix init check in oss-fuzz mode (diff) | |
download | monero-93257997bd69e25c76de8ebf3f46bfeb44f11589.tar.xz |
Merge pull request #6656
bde7f1c fuzz_tests: fix init check in oss-fuzz mode (moneromooo-monero)
c4b7420 Do not use PIE with OSS-Fuzz (moneromooo-monero)
c4df8b1 fix leaks in fuzz tests (moneromooo-monero)
38ca1bb fuzz_tests: add a tx extra fuzz test (moneromooo-monero)
Diffstat (limited to '')
-rw-r--r-- | tests/fuzz/fuzzer.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/fuzz/fuzzer.h b/tests/fuzz/fuzzer.h index 2d0a29dfc..ce230fb66 100644 --- a/tests/fuzz/fuzzer.h +++ b/tests/fuzz/fuzzer.h @@ -56,7 +56,7 @@ extern "C" { \ static bool first = true; \ if (first) \ { \ - if (!init()) \ + if (init()) \ return 1; \ first = false; \ } \ @@ -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; \ } \ }; \ |