summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Williams <nico@cryptonector.com>2017-02-26 16:32:43 -0600
committerNicolas Williams <nico@cryptonector.com>2017-02-26 16:33:50 -0600
commita03ae02f4489e35cc874bb529570092414eee729 (patch)
tree0ca4b69764a532caaae346b235404800fd163370
parent45f126514c6701838b12091b6cfe4047dea37f28 (diff)
Fix memory leak
-rw-r--r--src/execute.c3
1 files changed, 2 insertions, 1 deletions
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)