aboutsummaryrefslogtreecommitdiff
path: root/tests/fuzz/fuzzer.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/fuzz/fuzzer.h14
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; \
} \
}; \