diff src/eval.c @ 7931:2679e636e862 v7.4.1261

commit https://github.com/vim/vim/commit/4b6a6dcbe7bd13170c4884cc17acb1eac2c633d1 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 4 22:49:49 2016 +0100 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.
author Christian Brabandt <cb@256bit.org>
date Thu, 04 Feb 2016 23:00:06 +0100
parents bff95e0d8885
children 1f0743f4f88f
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -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_
 	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)