Bram,
the map() function leaks memory, when an error in the expression occurs.
This patch fixes it:
diff --git a/src/eval.c b/src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -10728,7 +10728,10 @@ filter_map(argvars, rettv, map)
vimvars[VV_KEY].vv_str = vim_strsave(di->di_key);
if (filter_map_one(&di->di_tv, expr, map, &rem) == FAIL
|| did_emsg)
+ {
+ clear_tv(&vimvars[VV_KEY].vv_tv);
break;
+ }
if (!map && rem)
dictitem_remove(d, di);
clear_tv(&vimvars[VV_KEY].vv_tv);
@@ -10782,6 +10785,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)
Best,
Christian
--
Die Engländer haben das Öl, die Franzosen die Kernkraft und die
Deutschen die Diskussion erfunden.
-- Lothar Späth
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.