summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Langford <wlangfor@gmail.com>2018-08-30 21:09:04 -0400
committerWilliam Langford <wlangfor@gmail.com>2018-08-30 21:09:04 -0400
commitdd4cec664cd2a45921189fab2a938a4966191a31 (patch)
tree7c353dbc39ebfc34d71537485265941dcaf0ae3b
parent46d1ce2667253f1a34cd389b6d00c0288ab0276f (diff)
fix memory leak
-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++;