vim-patch:7.4.1867

Problem:    Memory leak in test_matchstrpos.
Solution:   Free the string before overwriting. (Yegappan Lakshmanan)

3c809343c7
This commit is contained in:
James McCoy 2016-12-11 23:19:14 -05:00
parent 29e651515f
commit 2d3c835534
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
2 changed files with 3 additions and 1 deletions

View File

@ -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 *li2 = li1->li_next;
listitem_T *li3 = li2->li_next; listitem_T *li3 = li2->li_next;
listitem_T *li4 = li3->li_next; listitem_T *li4 = li3->li_next;
xfree(li1->li_tv.vval.v_string);
int rd = (int)(regmatch.endp[0] - regmatch.startp[0]); int rd = (int)(regmatch.endp[0] - regmatch.startp[0]);
li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0], rd); li1->li_tv.vval.v_string = vim_strnsave(regmatch.startp[0], rd);
li3->li_tv.vval.v_number = (varnumber_T)(regmatch.startp[0] - expr); li3->li_tv.vval.v_number = (varnumber_T)(regmatch.startp[0] - expr);

View File

@ -573,7 +573,7 @@ static int included_patches[] = {
// 1870 NA // 1870 NA
// 1869 NA // 1869 NA
// 1868, // 1868,
// 1867, 1867,
// 1866, // 1866,
// 1865 NA // 1865 NA
// 1864 NA // 1864 NA