From 0732be88d054db33fa0ca479eab9988c8e6be42e Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 13 Oct 2004 08:57:08 +0000 Subject: Load /tmp/tmp.zzO3vU/libxml2-2.6.14 into packages/libxml2/branches/upstream/current. --- xpath.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'xpath.c') diff --git a/xpath.c b/xpath.c index 3d21e72..9866736 100644 --- a/xpath.c +++ b/xpath.c @@ -1115,15 +1115,17 @@ extern int valuePush(xmlXPathParserContextPtr ctxt, xmlXPathObjectPtr value) { if (ctxt->valueNr >= ctxt->valueMax) { - ctxt->valueMax *= 2; - ctxt->valueTab = - (xmlXPathObjectPtr *) xmlRealloc(ctxt->valueTab, - ctxt->valueMax * + xmlXPathObjectPtr *tmp; + + tmp = (xmlXPathObjectPtr *) xmlRealloc(ctxt->valueTab, + 2 * ctxt->valueMax * sizeof(ctxt->valueTab[0])); - if (ctxt->valueTab == NULL) { + if (tmp == NULL) { xmlGenericError(xmlGenericErrorContext, "realloc failed !\n"); return (0); } + ctxt->valueMax *= 2; + ctxt->valueTab = tmp; } ctxt->valueTab[ctxt->valueNr] = value; ctxt->value = value; -- cgit v1.2.3