[xml] libxml memory leaks

I am using libxml2-2.6.26, cross-compiled for an ARM platform.

I am seeing very severe memory leaks - on the order of 40K per invocation of xmlXPathNewContext (if I read valgrind correctly...)

I've gone through the code, and I am using


paired with every invocation of xmlXPathNewContext.

I can't help but think that I am doing something seriously wrong....

I am only using three functions that allocate memory in the following order:

doc = xmlReadFile("file");
xpathCtx = xmlXPathNewContext(doc);
xpathObj = xmlXPathEvalExpression("expr",xpathCtx);

Is there some special way I need to free these pointers:

I am freeing them in the following order:


What am I missing?

(I can provide more info if someone can tell me what options to throw at valgrind...)


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