summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-23 15:41:20 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-23 15:41:20 +0000
commit0fed03f35a63c01e89c0ba91cfe92dfc226d1e86 (patch)
treeb37d9199667c4d524eff43fda67df6c57bc37bd5 /main.c
parent5578ec0f6981e9c01d92f0cda65dfc02605a030c (diff)
Fix a bad memory leak when using --raw-output
Diffstat (limited to 'main.c')
-rw-r--r--main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/main.c b/main.c
index 0ab0f3ca..fd482122 100644
--- a/main.c
+++ b/main.c
@@ -68,6 +68,7 @@ static void process(jv value) {
while (jv_is_valid(result = jq_next())) {
if ((options & RAW_OUTPUT) && jv_get_kind(result) == JV_KIND_STRING) {
fwrite(jv_string_value(result), 1, jv_string_length(jv_copy(result)), stdout);
+ jv_free(result);
} else {
int dumpopts;
#ifdef JQ_DEFAULT_ENABLE_COLOR