diff options
author | Raphaël Hertzog <hertzog@debian.org> | 2015-08-25 21:55:54 +0200 |
---|---|---|
committer | Raphaël Hertzog <hertzog@debian.org> | 2015-08-25 21:55:54 +0200 |
commit | 7300193becde71a344c8ac0973dc290fa24d800d (patch) | |
tree | 6490c364e7764294c209e536d42f3d31d23ebc0d /xpointer.c | |
parent | 3871a83a5f0aebd8c00879eab14fe901c93dbfcf (diff) | |
download | libxml2-7300193becde71a344c8ac0973dc290fa24d800d.tar.gz |
Imported Upstream version 2.9.1+dfsg1
Diffstat (limited to 'xpointer.c')
-rw-r--r-- | xpointer.c | 30 |
1 files changed, 2 insertions, 28 deletions
@@ -1375,8 +1375,6 @@ xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) { return(NULL); ctxt = xmlXPathNewParserContext(str, ctx); - if (ctxt == NULL) - return(NULL); ctxt->xptr = 1; xmlXPtrEvalXPointer(ctxt); @@ -1809,8 +1807,6 @@ xmlXPtrStartPointFunction(xmlXPathParserContextPtr ctxt, int nargs) { */ tmp = xmlXPtrNewLocationSetNodeSet(obj->nodesetval); xmlXPathFreeObject(obj); - if (tmp == NULL) - XP_ERROR(XPATH_MEMORY_ERROR) obj = tmp; } @@ -1905,16 +1901,10 @@ xmlXPtrEndPointFunction(xmlXPathParserContextPtr ctxt, int nargs) { */ tmp = xmlXPtrNewLocationSetNodeSet(obj->nodesetval); xmlXPathFreeObject(obj); - if (tmp == NULL) - XP_ERROR(XPATH_MEMORY_ERROR) obj = tmp; } newset = xmlXPtrLocationSetCreate(NULL); - if (newset == NULL) { - xmlXPathFreeObject(obj); - XP_ERROR(XPATH_MEMORY_ERROR); - } oldset = (xmlLocationSetPtr) obj->user; if (oldset != NULL) { int i; @@ -2059,8 +2049,6 @@ xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) { */ tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval); xmlXPathFreeObject(set); - if (tmp == NULL) - XP_ERROR(XPATH_MEMORY_ERROR) set = tmp; } oldset = (xmlLocationSetPtr) set->user; @@ -2069,10 +2057,6 @@ xmlXPtrRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) { * The loop is to compute the covering range for each item and add it */ newset = xmlXPtrLocationSetCreate(NULL); - if (newset == NULL) { - xmlXPathFreeObject(set); - XP_ERROR(XPATH_MEMORY_ERROR); - } for (i = 0;i < oldset->locNr;i++) { xmlXPtrLocationSetAdd(newset, xmlXPtrCoveringRange(ctxt, oldset->locTab[i])); @@ -2211,8 +2195,6 @@ xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) { */ tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval); xmlXPathFreeObject(set); - if (tmp == NULL) - XP_ERROR(XPATH_MEMORY_ERROR) set = tmp; } oldset = (xmlLocationSetPtr) set->user; @@ -2221,10 +2203,6 @@ xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) { * The loop is to compute the covering range for each item and add it */ newset = xmlXPtrLocationSetCreate(NULL); - if (newset == NULL) { - xmlXPathFreeObject(set); - XP_ERROR(XPATH_MEMORY_ERROR); - } for (i = 0;i < oldset->locNr;i++) { xmlXPtrLocationSetAdd(newset, xmlXPtrInsideRange(ctxt, oldset->locTab[i])); @@ -2483,6 +2461,8 @@ xmlXPtrMatchString(const xmlChar *string, xmlNodePtr start, int startindex, ((*end)->type == XML_NAMESPACE_DECL) || (endindex == NULL)) return(-1); cur = start; + if (cur == NULL) + return(-1); pos = startindex - 1; stringlen = xmlStrlen(string); @@ -2818,10 +2798,6 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) { set = valuePop(ctxt); newset = xmlXPtrLocationSetCreate(NULL); - if (newset == NULL) { - xmlXPathFreeObject(set); - XP_ERROR(XPATH_MEMORY_ERROR); - } if (set->nodesetval == NULL) { goto error; } @@ -2833,8 +2809,6 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) { */ tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval); xmlXPathFreeObject(set); - if (tmp == NULL) - XP_ERROR(XPATH_MEMORY_ERROR) set = tmp; } oldset = (xmlLocationSetPtr) set->user; |