1
0
mirror of https://github.com/stedolan/jq.git synced 2024-05-11 05:55:39 +00:00

Fix a bad memory leak when using --raw-output

This commit is contained in:
Stephen Dolan
2012-12-23 15:41:20 +00:00
parent 5578ec0f69
commit 0fed03f35a

1
main.c
View File

@ -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