1
0
forked from aniani/vim

patch 8.0.0170: crash in channel test

Problem:    Channel test fails for using freed memory.
Solution:   Fix memory use in json_decode().
This commit is contained in:
Bram Moolenaar
2017-01-10 22:57:34 +01:00
parent 8b2f19536f
commit e32abbe42c
2 changed files with 4 additions and 1 deletions

View File

@@ -577,6 +577,8 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
ga_init2(&stack, sizeof(json_dec_item_T), 100);
cur_item = res;
init_tv(&item);
if (res != NULL)
init_tv(res);
fill_numbuflen(reader);
p = reader->js_buf + reader->js_used;
@@ -985,7 +987,6 @@ item_end:
theend:
ga_clear(&stack);
clear_tv(&item);
return retval;
}