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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user