1
0
forked from aniani/vim

patch 8.0.0828: Coverity: may dereference NULL pointer

Problem:    Coverity: may dereference NULL pointer.
Solution:   Bail out if calloc_state() returns NULL.
This commit is contained in:
Bram Moolenaar 2017-08-01 15:14:26 +02:00
parent 979e8c5346
commit 983b3a5bc4
2 changed files with 6 additions and 0 deletions

View File

@ -3527,7 +3527,11 @@ post2nfa(int *postfix, int *end, int nfa_calc_size)
{
/* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */
skip = alloc_state(NFA_SKIP, NULL, NULL);
if (skip == NULL)
goto theend;
zend = alloc_state(NFA_ZEND, s1, NULL);
if (zend == NULL)
goto theend;
s1->out= skip;
patch(e.out, zend);
PUSH(frag(s, list1(&skip->out)));

View File

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