# HG changeset patch # User Christian Brabandt # Date 1484085605 -3600 # Node ID e025378406d10194e7c389d08d9806060759fd37 # Parent 1c09563f6fa409d11b6f9cab8354a652108f81cd patch 8.0.0170: crash in channel test commit https://github.com/vim/vim/commit/e32abbe42c921c5e521420417abe5bc301e540b3 Author: Bram Moolenaar Date: Tue Jan 10 22:57:34 2017 +0100 patch 8.0.0170: crash in channel test Problem: Channel test fails for using freed memory. Solution: Fix memory use in json_decode(). diff --git a/src/json.c b/src/json.c --- a/src/json.c +++ b/src/json.c @@ -577,6 +577,8 @@ json_decode_item(js_read_T *reader, typv 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; } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 170, +/**/ 169, /**/ 168,