diff --git a/tests/jq_fuzz_execute.cpp b/tests/jq_fuzz_execute.cpp index 223d4fe36a..66a044f380 100644 --- a/tests/jq_fuzz_execute.cpp +++ b/tests/jq_fuzz_execute.cpp @@ -27,9 +27,11 @@ extern "C" int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) { jv_free(actual); } jv_free(next); + } else { + // Only free if input is invalid as otherwise jq_teardown + // frees it. + jv_free(input); } - - // Do not free "input" as this is handled by jq_teardown. } } jq_teardown(&jq);