0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 7.4.1261

Problem:    Pending channel messages are garbage collected. Leaking memory in
            ch_sendexpr().  Leaking memory for a decoded JSON string.
Solution:   Mark the message list as used. Free the encoded JSON.  Don't save
            the JSON string.
This commit is contained in:
Bram Moolenaar
2016-02-04 22:49:49 +01:00
parent a8343c1808
commit 4b6a6dcbe7
5 changed files with 34 additions and 4 deletions

View File

@@ -533,10 +533,7 @@ json_decode_string(js_read_T *reader, typval_T *res)
if (res != NULL)
{
res->v_type = VAR_STRING;
if (ga.ga_data == NULL)
res->vval.v_string = NULL;
else
res->vval.v_string = vim_strsave(ga.ga_data);
res->vval.v_string = ga.ga_data;
}
return OK;
}