wpp: Correctly handle OOM in pop_buffer().

This commit is contained in:
Matteo Bruni 2014-06-26 19:52:32 +02:00 committed by Alexandre Julliard
parent 1b79df4e80
commit b5db97ac51
1 changed files with 14 additions and 13 deletions

View File

@ -1354,9 +1354,8 @@ static bufferstackentry_t *pop_buffer(void)
if(ppp) if(ppp)
{ {
iep = pp_xmalloc(sizeof(includelogicentry_t)); iep = pp_xmalloc(sizeof(includelogicentry_t));
if(!iep) if (iep)
return NULL; {
iep->ppp = ppp; iep->ppp = ppp;
ppp->iep = iep; ppp->iep = iep;
iep->filename = bufferstack[bufferstackidx].include_filename; iep->filename = bufferstack[bufferstackidx].include_filename;
@ -1366,7 +1365,9 @@ static bufferstackentry_t *pop_buffer(void)
iep->next->prev = iep; iep->next->prev = iep;
pp_includelogiclist = iep; pp_includelogiclist = iep;
if(pp_status.debug) if(pp_status.debug)
fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename); fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n",
bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename);
}
} }
} }
free(pp_incl_state.ppp); free(pp_incl_state.ppp);