summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/execute.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/execute.c b/src/execute.c
index 8eb41cc7..d7a9615d 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -819,6 +819,8 @@ jv jq_next(jq_state *jq) {
if (opcode != ON_BACKTRACK(DESTRUCTURE_ALT)) {
jv_free(stack_pop(jq)); // free the input
stack_push(jq, jv_invalid_get_msg(jq->error)); // push the error's message
+ } else {
+ jv_free(jq->error);
}
jq->error = jv_null();
uint16_t offset = *pc++;