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.
diff --git a/src/channel.c b/src/channel.c
index 1290171..0ae90a9 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1315,4 +1315,29 @@
return ret;
}
+ int
+set_ref_in_channel(int copyID)
+{
+ int i;
+ int abort = FALSE;
+
+ for (i = 0; i < channel_count; ++i)
+ {
+ jsonq_T *head = &channels[i].ch_json_head;
+ jsonq_T *item = head->next;
+
+ while (item != head)
+ {
+ list_T *l = item->value->vval.v_list;
+
+ if (l->lv_copyID != copyID)
+ {
+ l->lv_copyID = copyID;
+ abort = abort || set_ref_in_list(l, copyID, NULL);
+ }
+ item = item->next;
+ }
+ }
+ return abort;
+}
#endif /* FEAT_CHANNEL */