From 8913a52926b3ca6ead4224ef67790e6ea60853f3 Mon Sep 17 00:00:00 2001 From: kwaclaw Date: Tue, 29 Sep 2009 02:49:16 +0000 Subject: [PATCH] - Fix for issue # 2855609 & 2518079. - Some code cosmetics. --- lib/xmlparse.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/xmlparse.c b/lib/xmlparse.c index fcbb6d1..9c7ac2b 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -1513,15 +1513,11 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal) : (char *)REALLOC(buffer, len * 2)); if (temp == NULL) { errorCode = XML_ERROR_NO_MEMORY; - return XML_STATUS_ERROR; - } - buffer = temp; - if (!buffer) { - errorCode = XML_ERROR_NO_MEMORY; eventPtr = eventEndPtr = NULL; processor = errorProcessor; return XML_STATUS_ERROR; } + buffer = temp; bufferLim = buffer + len * 2; } memcpy(buffer, end, nLeftOver); @@ -1672,6 +1668,8 @@ XML_GetBuffer(XML_Parser parser, int len) bufferPtr = buffer = newBuf; #endif /* not defined XML_CONTEXT_BYTES */ } + eventPtr = eventEndPtr = NULL; + positionPtr = NULL; } return bufferEnd; } @@ -4949,7 +4947,7 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata, if (!entity->textPtr) { if (enc == encoding) eventPtr = ptr; - return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; + return XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF; } else { enum XML_Error result; -- 2.11.4.GIT