diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2021-03-25 09:56:18 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2021-03-25 09:56:18 +0000 |
commit | abce83d1cf6ccdb832af78c0e4b57e21fbf34169 (patch) | |
tree | 326ccf24029a9f44cbdab4e42e0c0b2f330ad793 /fuzz | |
parent | Prevent memory leak in fuzzer (diff) | |
download | w3m-abce83d1cf6ccdb832af78c0e4b57e21fbf34169.tar.gz w3m-abce83d1cf6ccdb832af78c0e4b57e21fbf34169.zip |
Explicitly call GC_gcollect() in fuzzer
Diffstat (limited to 'fuzz')
-rw-r--r-- | fuzz/fuzz-conv.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fuzz/fuzz-conv.c b/fuzz/fuzz-conv.c index ae6d31f..0790a63 100644 --- a/fuzz/fuzz-conv.c +++ b/fuzz/fuzz-conv.c @@ -45,6 +45,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){ return 0; } + GC_disable(); + char *new_str1 = get_null_terminated(data, 20); data += 20; size -= 20; char *new_str2 = get_null_terminated(data, size); @@ -76,5 +78,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){ free(new_str1); free(new_str2); + + GC_enable(); + GC_gcollect(); + return 0; } |