[xml] namespace list leak in xmlXPathTryStreamCompile



I am seeing a memory leak within xmlXPathTryStreamCompile. The namespace list is malloc'd, but never freed. Not sure if there is any impact on libxslt (doubt it), but I see Kasimier has been fixing a bunch of things there, so sending a patch for this.

Rob
Index: xpath.c
===================================================================
RCS file: /cvs/gnome/gnome-xml/xpath.c,v
retrieving revision 1.302
diff -c -r1.302 xpath.c
*** xpath.c     10 Mar 2006 13:40:16 -0000      1.302
--- xpath.c     16 May 2006 10:21:38 -0000
***************
*** 11405,11410 ****
--- 11405,11413 ----
  
        stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH,
                        &namespaces[0]);
+       if (namespaces != NULL) {
+               xmlFree((xmlChar **)namespaces);
+       }
        if ((stream != NULL) && (xmlPatternStreamable(stream) == 1)) {
            comp = xmlXPathNewCompExpr();
            if (comp == NULL) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]