forked from aniani/vim
patch 7.4.939
Problem: Memory leak when encountering a syntax error. Solution: Free the memory. (Dominique Pelle)
This commit is contained in:
@@ -12117,6 +12117,7 @@ ex_match(eap)
|
||||
if (*p == NUL)
|
||||
{
|
||||
/* There must be two arguments. */
|
||||
vim_free(g);
|
||||
EMSG2(_(e_invarg2), eap->arg);
|
||||
return;
|
||||
}
|
||||
@@ -12125,11 +12126,13 @@ ex_match(eap)
|
||||
{
|
||||
if (*end != NUL && !ends_excmd(*skipwhite(end + 1)))
|
||||
{
|
||||
vim_free(g);
|
||||
eap->errmsg = e_trailing;
|
||||
return;
|
||||
}
|
||||
if (*end != *p)
|
||||
{
|
||||
vim_free(g);
|
||||
EMSG2(_(e_invarg2), p);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user