1
0
forked from aniani/vim

updated for version 7.4.525

Problem:    map() leaks memory when there is an error in the expression.
Solution:   Call clear_tv(). (Christian Brabandt)
This commit is contained in:
Bram Moolenaar
2014-11-19 20:04:48 +01:00
parent 2683c8e7f7
commit b738c9a442
2 changed files with 8 additions and 3 deletions

View File

@@ -10720,18 +10720,20 @@ filter_map(argvars, rettv, map)
{
if (!HASHITEM_EMPTY(hi))
{
int r;
--todo;
di = HI2DI(hi);
if (tv_check_lock(di->di_tv.v_lock,
(char_u *)_(arg_errmsg)))
break;
vimvars[VV_KEY].vv_str = vim_strsave(di->di_key);
if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL
|| did_emsg)
r = filter_map_one(&di->di_tv, expr, map, &rem);
clear_tv(&vimvars[VV_KEY].vv_tv);
if (r == FAIL || did_emsg)
break;
if (!map && rem)
dictitem_remove(d, di);
clear_tv(&vimvars[VV_KEY].vv_tv);
}
}
hash_unlock(ht);
@@ -10782,6 +10784,7 @@ filter_map_one(tv, expr, map, remp)
if (*s != NUL) /* check for trailing chars after expr */
{
EMSG2(_(e_invexpr2), s);
clear_tv(&rettv);
goto theend;
}
if (map)

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
525,
/**/
524,
/**/