diff options
author | Mike Hommey <mh@glandium.org> | 2004-10-13 08:57:08 +0000 |
---|---|---|
committer | Mike Hommey <mh@glandium.org> | 2004-10-13 08:57:08 +0000 |
commit | 0732be88d054db33fa0ca479eab9988c8e6be42e (patch) | |
tree | 8b9cf70e04bd32115caebeb74cb0d841d1eced3b /xpath.c | |
parent | 09deb06614c3408ec0816a3c88920138bae2083c (diff) | |
download | libxml2-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.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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; |