aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-12-11 23:19:14 -0500
committerJames McCoy <jamessan@jamessan.com>2016-12-11 23:21:51 -0500
commit2d3c835534236056cbee8279b7d0ed08bf1c6022 (patch)
treee0ad0919fd0e4ea5869f0972d80c697a6c833855 /src
parent29e651515fec1a4bc2cd41ed1c04eb5d03250525 (diff)
downloadrneovim-2d3c835534236056cbee8279b7d0ed08bf1c6022.tar.gz
rneovim-2d3c835534236056cbee8279b7d0ed08bf1c6022.tar.bz2
rneovim-2d3c835534236056cbee8279b7d0ed08bf1c6022.zip
vim-patch:7.4.1867
Problem: Memory leak in test_matchstrpos. Solution: Free the string before overwriting. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/3c809343c72d9964475f421fd03bb892bc584a51
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/version.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 71d60d6b45..2a2f94f629 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -12317,6 +12317,8 @@ static void find_some_match(typval_T *argvars, typval_T *rettv, int type)
listitem_T *li2 = li1->li_next;
listitem_T *li3 = li2->li_next;
listitem_T *li4 = li3->li_next;
+ xfree(li1->li_tv.vval.v_string);
+
int rd = (int)(regmatch.endp[0] - regmatch.startp[0]);
li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0], rd);
li3->li_tv.vval.v_number = (varnumber_T)(regmatch.startp[0] - expr);
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 7e7080fd61..348bf3c014 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -573,7 +573,7 @@ static int included_patches[] = {
// 1870 NA
// 1869 NA
// 1868,
- // 1867,
+ 1867,
// 1866,
// 1865 NA
// 1864 NA