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
index 091d98f..2cc3a2a 100644
--- a/src/json.c
+++ b/src/json.c
@@ -577,6 +577,8 @@
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 @@
theend:
ga_clear(&stack);
- clear_tv(&item);
return retval;
}
diff --git a/src/version.c b/src/version.c
index 23dd5ae..4bc287f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 170,
+/**/
169,
/**/
168,