Skip to content

Commit

Permalink
jq_fuzz_execute: fix memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski authored Dec 3, 2023
1 parent bfb7fd5 commit 693a726
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/jq_fuzz_execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 693a726

Please sign in to comment.