From a03ae02f4489e35cc874bb529570092414eee729 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Sun, 26 Feb 2017 16:32:43 -0600 Subject: Fix memory leak --- src/execute.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/execute.c b/src/execute.c index bc39c0c9..44c76a4c 100644 --- a/src/execute.c +++ b/src/execute.c @@ -1100,7 +1100,8 @@ int jq_compile_args(jq_state *jq, const char* str, jv args) { if (nerrors == 0) { nerrors = block_compile(program, &jq->bc, locations, args = args2obj(args)); } - } + } else + jv_free(args); if (nerrors) jq_report_error(jq, jv_string_fmt("jq: %d compile %s", nerrors, nerrors > 1 ? "errors" : "error")); if (jq->bc) -- cgit v1.2.3