List Info

Thread: namespace list leak in xmlXPathTryStreamCompile




namespace list leak in xmlXPathTryStreamCompile
user name
2006-05-16 11:04:01
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) {
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )