summaryrefslogtreecommitdiff
path: root/xpath.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2004-10-13 08:57:08 +0000
committerMike Hommey <mh@glandium.org>2004-10-13 08:57:08 +0000
commit0732be88d054db33fa0ca479eab9988c8e6be42e (patch)
tree8b9cf70e04bd32115caebeb74cb0d841d1eced3b /xpath.c
parent09deb06614c3408ec0816a3c88920138bae2083c (diff)
downloadlibxml2-0732be88d054db33fa0ca479eab9988c8e6be42e.tar.gz
Load /tmp/tmp.zzO3vU/libxml2-2.6.14 intoupstream/2.6.14
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'xpath.c')
-rw-r--r--xpath.c12
1 files changed, 7 insertions, 5 deletions
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;