Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
7930:abea5eb9092d | 7931:2679e636e862 |
---|---|
6851 abort = abort || set_ref_in_python(copyID); | 6851 abort = abort || set_ref_in_python(copyID); |
6852 #endif | 6852 #endif |
6853 | 6853 |
6854 #ifdef FEAT_PYTHON3 | 6854 #ifdef FEAT_PYTHON3 |
6855 abort = abort || set_ref_in_python3(copyID); | 6855 abort = abort || set_ref_in_python3(copyID); |
6856 #endif | |
6857 | |
6858 #ifdef FEAT_CHANNEL | |
6859 abort = abort || set_ref_in_channel(copyID); | |
6856 #endif | 6860 #endif |
6857 | 6861 |
6858 if (!abort) | 6862 if (!abort) |
6859 { | 6863 { |
6860 /* | 6864 /* |
9840 text = json_encode_nr_expr(id, &argvars[1]); | 9844 text = json_encode_nr_expr(id, &argvars[1]); |
9841 if (text == NULL) | 9845 if (text == NULL) |
9842 return; | 9846 return; |
9843 | 9847 |
9844 ch_idx = send_common(argvars, text, "sendexpr"); | 9848 ch_idx = send_common(argvars, text, "sendexpr"); |
9849 vim_free(text); | |
9845 if (ch_idx >= 0) | 9850 if (ch_idx >= 0) |
9846 { | 9851 { |
9847 if (channel_read_json_block(ch_idx, id, &listtv) == OK) | 9852 if (channel_read_json_block(ch_idx, id, &listtv) == OK) |
9848 { | 9853 { |
9849 if (listtv->v_type == VAR_LIST) | 9854 if (listtv->v_type == VAR_LIST) |