diff options
author | Clément MATHIEU <clement@unportant.info> | 2017-01-03 22:19:58 +0100 |
---|---|---|
committer | Nico Williams <nico@cryptonector.com> | 2017-01-23 15:18:51 -0600 |
commit | eeba7b31676c1a43f2031181cfef90033da6b080 (patch) | |
tree | b952067f47903c27931f8b9e168ea95e6887c43a | |
parent | e5c30e6faeac0aaca64ece2461b436dd87cbf5ff (diff) |
Fix input_(line_number|filename) leak memory
-rw-r--r-- | src/builtin.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/builtin.c b/src/builtin.c index 0edca38f..5f37ddfb 100644 --- a/src/builtin.c +++ b/src/builtin.c @@ -1227,14 +1227,17 @@ static jv f_now(jq_state *jq, jv a) { } #endif -static jv f_current_filename(jq_state *jq) { +static jv f_current_filename(jq_state *jq, jv a) { + jv_free(a); + jv r = jq_util_input_get_current_filename(jq); if (jv_is_valid(r)) return r; jv_free(r); return jv_null(); } -static jv f_current_line(jq_state *jq) { +static jv f_current_line(jq_state *jq, jv a) { + jv_free(a); return jq_util_input_get_current_line(jq); } |