changeset 9167:9bbe6ec0e6dc v7.4.1867

commit https://github.com/vim/vim/commit/3c809343c72d9964475f421fd03bb892bc584a51 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 1 22:34:48 2016 +0200 patch 7.4.1867 Problem: Memory leak in test_matchstrpos. Solution: Free the string before overwriting. (Yegappan Lakshmanan)
author Christian Brabandt <cb@256bit.org>
date Wed, 01 Jun 2016 22:45:07 +0200
parents f26bd55ed226
children 702732dc3ed7
files src/eval.c src/version.c
diffstat 2 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -15773,6 +15773,7 @@ find_some_match(typval_T *argvars, typva
 		listitem_T *li3 = li2->li_next;
 		listitem_T *li4 = li3->li_next;
 
+		vim_free(li1->li_tv.vval.v_string);
 		li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0],
 				(int)(regmatch.endp[0] - regmatch.startp[0]));
 		li3->li_tv.vval.v_number =
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1867,
+/**/
     1866,
 /**/
     1865,