diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-02-04 22:49:49 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-02-04 22:49:49 +0100 |
commit | 4b6a6dcbe7bd13170c4884cc17acb1eac2c633d1 (patch) | |
tree | 9d02e26cd34ab973630872b8953d23d0fcb67a54 /src/json.c | |
parent | a8343c1808f2f268282f3030ce4adaf22e8ade54 (diff) | |
download | vim-git-4b6a6dcbe7bd13170c4884cc17acb1eac2c633d1.tar.gz |
patch 7.4.1261v7.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.
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/json.c b/src/json.c index f97d28312..b6fce02dc 100644 --- a/src/json.c +++ b/src/json.c @@ -533,10 +533,7 @@ json_decode_string(js_read_T *reader, typval_T *res) if (res != NULL) { res->v_type = VAR_STRING; - if (ga.ga_data == NULL) - res->vval.v_string = NULL; - else - res->vval.v_string = vim_strsave(ga.ga_data); + res->vval.v_string = ga.ga_data; } return OK; } |