[xml] testXPath memory leak?

Date view Thread view Subject view Author view

From: Diego Hernan Weizel (DHWeizel@sif.com.ar)
Date: Tue Sep 05 2000 - 10:32:23 EDT


Hello, first I request excuses by my English because it is not my native
language.

I have an "test.xml" file containing following :
----------------------------------------------------------------------------

----
<?xml version="1.0"?>
<BODY>
<DECLARACION importador="123456789" fecha="08/09/2000"
monto_factura="100.09" pa
<ITEM monto="50.12" divisa="DOL">
<SUFIJO codigo="NL34" valor="negro"/>
<SUFIJO codigo="AS34" valor="grande"/>
</ITEM>
</DECLARACION>
<FIRMA>N</FIRMA>
</BODY>
----------------------------------------------------------------------------
----
I'm using libxml 2.2.2 and I'd like to be able to select first node "ITEM"
using an XPath expression like:

testXPath -i test.xml "//ITEM[1]"

Object is a Node Set : Set contains 1 nodes: 1 ELEMENT ITEM ATTRIBUTE monto TEXT content=50.12 ATTRIBUTE divisa TEXT content=DOL

The result is Ok., but when I watch the file .memorydump I found the following thing: cat .memdump

Tue Sep 5 10:47:38 2000

MEMORY ALLOCATED : 80, MAX was 11036 BLOCK NUMBER SIZE TYPE 0 307 28 malloc() in xpath.c(713) 1 304 40 malloc() in xpath.c(373) 2 303 12 malloc() in xpath.c(365) pointer to #304 at index 8

Is this a memry leak? The problem seems to be in the function xmlXPathEvalPredicate in the line:

/* This line was missed out: */ ctxt->context->nodelist = xmlXPathNodeSetCreate(ctxt->context->node);

It would not be necessary to release this object?

/*Copy the contents of the temporary list back to the node list for the next round //ctxt->context->nodelist = xmlXPathNewNodeSetList(listHolder->nodesetval)->nodesetval

Is not being lost an object when making the call to nodesetval?

We released the objects and solved the problem, but we are not sure that it is the correct form.

---- Message from the list xml@rpmfind.net Archived at : http://xmlsoft.org/messages/ to unsubscribe: echo "unsubscribe xml" | mail majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Tue Sep 05 2000 - 10:43:40 EDT