jq_fuzz_execute: fix memory leak

Signed-off-by: David Korczynski <david@adalogics.com>
This commit is contained in:
DavidKorczynski authored and GitHub committed 2023-12-03 03:53:49 +01:00
1 parent bfb7fd570f
commit 693a7261e5
1 file changed
+4 -2
+4 -2
View File
@@ -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);