After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756075 - Remove unused code from xmlXPathNextNamespace
Remove unused code from xmlXPathNextNamespace
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-05 10:35 UTC by Gaurav
Modified: 2016-05-05 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Remove unused code from xmlXPathNextNamespace (615 bytes, patch)
2015-10-05 10:35 UTC, Gaurav
none Details | Review

Description Gaurav 2015-10-05 10:35:54 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.
Comment 1 Nick Wellnhofer 2016-05-05 14:13:00 UTC
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