summaryrefslogtreecommitdiffstats
path: root/src/execute.c
diff options
context:
space:
mode:
authorEmanuele Torre <torreemanuele6@gmail.com>2024-03-15 14:30:03 +0100
committerGitHub <noreply@github.com>2024-03-15 14:30:03 +0100
commit6f67bae60b7d5d1d34438f78acc12266b6dc1f0c (patch)
tree749f86fdae27ccab19c84795564ba1c5cebc78c0 /src/execute.c
parentc95b34ff827d05a2d262f00280a4891a295ed0ed (diff)
EACH: fix leak when an error is triggered by non-last element of object
Object keys are strings, so they need to be freed. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66070
Diffstat (limited to 'src/execute.c')
-rw-r--r--src/execute.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/execute.c b/src/execute.c
index 9ef83683..3d2ae0e0 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -781,8 +781,10 @@ jv jq_next(jq_state *jq) {
}
if (!keep_going || raising) {
- if (keep_going)
+ if (keep_going) {
+ jv_free(key);
jv_free(value);
+ }
jv_free(container);
goto do_backtrack;
} else if (is_last) {