]> granicus.if.org Git - jq/commitdiff
Fix memory leak
authorNicolas Williams <nico@cryptonector.com>
Sun, 26 Feb 2017 22:32:43 +0000 (16:32 -0600)
committerNicolas Williams <nico@cryptonector.com>
Sun, 26 Feb 2017 22:33:50 +0000 (16:33 -0600)
src/execute.c

index bc39c0c9ee80eaada0911469d67b396c762a5e03..44c76a4c70c7e50bdecbf5b20fee8ce8b03f3a02 100644 (file)
@@ -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)