1
0
forked from aniani/vim

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

@@ -6855,6 +6855,10 @@ garbage_collect(void)
abort = abort || set_ref_in_python3(copyID);
#endif
#ifdef FEAT_CHANNEL
abort = abort || set_ref_in_channel(copyID);
#endif
if (!abort)
{
/*
@@ -9842,6 +9846,7 @@ f_ch_sendexpr(typval_T *argvars, typval_T *rettv)
return;
ch_idx = send_common(argvars, text, "sendexpr");
vim_free(text);
if (ch_idx >= 0)
{
if (channel_read_json_block(ch_idx, id, &listtv) == OK)