GNOME Bugzilla – Bug 756075
Remove unused code from xmlXPathNextNamespace
Last modified: 2016-05-05 14:13:00 UTC
Created attachment 312669 [details] [review] Remove unused code from xmlXPathNextNamespace @@ -8391,8 +8391,6 @@ xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) { if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL); if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL); if (ctxt->context->tmpNsList == NULL && cur != (xmlNodePtr) xmlXPathXMLNamespace) { - if (ctxt->context->tmpNsList != NULL) - xmlFree(ctxt->context->tmpNsList); ctxt->context->tmpNsList = xmlGetNsList(ctxt->context->doc, ctxt->context->node); ctxt->context->tmpNsNr = 0; Since, if condition is satisfied if ctxt->context->tmpNsList is Null, so checking to not Null is redundant. Removed this in attached patch.
The fix for bug #750037 changed the condition in the outer if-statement. Now the inner check isn't redundant anymore. https://git.gnome.org/browse/libxml2/commit/?id=82b73039dc0eed620621cb699b1140c6e0c89cce