mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-patch:7.4.939
Problem: Memory leak when encountering a syntax error.
Solution: Free the memory. (Dominique Pelle)
9a7d58e42e
This commit is contained in:
@@ -9387,17 +9387,20 @@ static void ex_match(exarg_T *eap)
|
|||||||
g = vim_strnsave(eap->arg, (int)(p - eap->arg));
|
g = vim_strnsave(eap->arg, (int)(p - eap->arg));
|
||||||
p = skipwhite(p);
|
p = skipwhite(p);
|
||||||
if (*p == NUL) {
|
if (*p == NUL) {
|
||||||
/* There must be two arguments. */
|
// There must be two arguments.
|
||||||
|
xfree(g);
|
||||||
EMSG2(_(e_invarg2), eap->arg);
|
EMSG2(_(e_invarg2), eap->arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
end = skip_regexp(p + 1, *p, TRUE, NULL);
|
end = skip_regexp(p + 1, *p, TRUE, NULL);
|
||||||
if (!eap->skip) {
|
if (!eap->skip) {
|
||||||
if (*end != NUL && !ends_excmd(*skipwhite(end + 1))) {
|
if (*end != NUL && !ends_excmd(*skipwhite(end + 1))) {
|
||||||
|
xfree(g);
|
||||||
eap->errmsg = e_trailing;
|
eap->errmsg = e_trailing;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (*end != *p) {
|
if (*end != *p) {
|
||||||
|
xfree(g);
|
||||||
EMSG2(_(e_invarg2), p);
|
EMSG2(_(e_invarg2), p);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -351,7 +351,7 @@ static int included_patches[] = {
|
|||||||
// 942,
|
// 942,
|
||||||
// 941,
|
// 941,
|
||||||
// 940 NA
|
// 940 NA
|
||||||
// 939,
|
939,
|
||||||
// 938 NA
|
// 938 NA
|
||||||
// 937,
|
// 937,
|
||||||
// 936,
|
// 936,
|
||||||
|
Reference in New Issue
Block a user