0
0
mirror of https://github.com/vim/vim.git synced 2025-07-24 10:45:12 -04:00

patch 8.1.1950: using NULL pointer after an out-of-memory

Problem:    Using NULL pointer after an out-of-memory.
Solution:   Check for NULL pointer. (Dominique Pelle, closes #4881)
This commit is contained in:
Bram Moolenaar 2019-08-31 15:28:02 +02:00
parent 8c6173c7d3
commit 4bbfb0f3cc
2 changed files with 3 additions and 1 deletions

View File

@ -5222,7 +5222,7 @@ syn_cmd_region(
for (item = ITEM_START; item <= ITEM_END; ++item)
for (ppp = pat_ptrs[item]; ppp != NULL; ppp = ppp_next)
{
if (!success)
if (!success && ppp->pp_synp != NULL)
{
vim_regfree(ppp->pp_synp->sp_prog);
vim_free(ppp->pp_synp->sp_pattern);

View File

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