Matteo Bruni : wpp: Correctly handle OOM in pop_buffer().

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jun 26 15:04:52 CDT 2014


Module: wine
Branch: master
Commit: b5db97ac51cf3ec962d7f26c87130c1b5ac747b6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b5db97ac51cf3ec962d7f26c87130c1b5ac747b6

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Thu Jun 26 19:52:32 2014 +0200

wpp: Correctly handle OOM in pop_buffer().

---

 libs/wpp/ppl.l | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l
index 0ce64c2..243049a 100644
--- a/libs/wpp/ppl.l
+++ b/libs/wpp/ppl.l
@@ -1354,19 +1354,20 @@ static bufferstackentry_t *pop_buffer(void)
 				if(ppp)
 				{
 					iep = pp_xmalloc(sizeof(includelogicentry_t));
-					if(!iep)
-						return NULL;
-
-					iep->ppp = ppp;
-					ppp->iep = iep;
-					iep->filename = bufferstack[bufferstackidx].include_filename;
-                                        iep->prev = NULL;
-					iep->next = pp_includelogiclist;
-					if(iep->next)
-						iep->next->prev = iep;
-					pp_includelogiclist = iep;
-					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);
+					if (iep)
+					{
+						iep->ppp = ppp;
+						ppp->iep = iep;
+						iep->filename = bufferstack[bufferstackidx].include_filename;
+						iep->prev = NULL;
+						iep->next = pp_includelogiclist;
+						if(iep->next)
+							iep->next->prev = iep;
+						pp_includelogiclist = iep;
+						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);
+					}
 				}
 			}
 			free(pp_incl_state.ppp);




More information about the wine-cvs mailing list