Skip to content

Commit

Permalink
jq_fuzz_parse_extended.c: don't jv_free() twice
Browse files Browse the repository at this point in the history
jv_dump() frees its argument.

I missed this problem before merging jqlang#2952, whoops! =)

fixup from eb3b565
  • Loading branch information
emanuele6 committed Nov 28, 2023
1 parent 4570c23 commit f4bb965
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/jq_fuzz_parse_extended.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ int LLVMFuzzerTestOneInput(uint8_t *data, size_t size) {
jv res = jv_parse_custom_flags(null_terminated, fuzz_flags);
if (jv_is_valid(res)) {
jv_dump(res, dump_flags);
} else {
jv_free(res);
}
jv_free(res);


// Free the null-terminated string
free(null_terminated);

Expand Down

0 comments on commit f4bb965

Please sign in to comment.