]> granicus.if.org Git - jq/commitdiff
Fix a bad memory leak when using --raw-output
authorStephen Dolan <mu@netsoc.tcd.ie>
Sun, 23 Dec 2012 15:41:20 +0000 (15:41 +0000)
committerStephen Dolan <mu@netsoc.tcd.ie>
Sun, 23 Dec 2012 15:41:20 +0000 (15:41 +0000)
main.c

diff --git a/main.c b/main.c
index 0ab0f3cac9dd81c87c0720deafef480dab6dbf10..fd482122521e08f7c9db999e1c165a92bed8846a 100644 (file)
--- 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