Mercurial > vim
comparison src/channel.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 | e44240b5a6da |
children | 1f0743f4f88f |
comparison
equal
deleted
inserted
replaced
7930:abea5eb9092d | 7931:2679e636e862 |
---|---|
1313 ret = TRUE; | 1313 ret = TRUE; |
1314 } | 1314 } |
1315 return ret; | 1315 return ret; |
1316 } | 1316 } |
1317 | 1317 |
1318 int | |
1319 set_ref_in_channel(int copyID) | |
1320 { | |
1321 int i; | |
1322 int abort = FALSE; | |
1323 | |
1324 for (i = 0; i < channel_count; ++i) | |
1325 { | |
1326 jsonq_T *head = &channels[i].ch_json_head; | |
1327 jsonq_T *item = head->next; | |
1328 | |
1329 while (item != head) | |
1330 { | |
1331 list_T *l = item->value->vval.v_list; | |
1332 | |
1333 if (l->lv_copyID != copyID) | |
1334 { | |
1335 l->lv_copyID = copyID; | |
1336 abort = abort || set_ref_in_list(l, copyID, NULL); | |
1337 } | |
1338 item = item->next; | |
1339 } | |
1340 } | |
1341 return abort; | |
1342 } | |
1318 #endif /* FEAT_CHANNEL */ | 1343 #endif /* FEAT_CHANNEL */ |