[xml] Memory leak in xmlXPathEvalExpression()



The following psydo-code (is actually Pascal code; I do not have a C memory checker available) produces a 
5-12 byte memory leak (unable to tell the exact number of bytes):

  xmlInitParser;

  Doc := htmlParseDoc('<html></html>', nil);
  XPathCtx := xmlXPathNewContext(Doc);
  XPathObj := xmlXPathEvalExpression('//a[ href=http://hello.com]', XPathCtx);

  xmlXPathFreeObject(XPathObj);
  xmlXPathFreeContext(XPathCtx);
  xmlFreeDoc(Doc);

  xmlCleanupParser;

Here is the stack trace:
  
  40FF18 [malloc][3730]
  4CB592 [xmlstrndup][53920]
  4AFC84 [xmlXPathParseNCName][35626]
  4B3555 [xmlXPathIsNodeType][37103]
  4B39A7 [xmlXPathIsNodeType][37218]
  4B3ADF [xmlXPathIsNodeType][37253]
  4B1BCA [xmlXPathIsNodeType][36461]
  4B1D1C [xmlXPathIsNodeType][36493]
  4B1F60 [xmlXPathIsNodeType][36533]
  4B1FD2 [xmlXPathIsNodeType][36558]
  4B21EE [xmlXPathIsNodeType][36599]

Ralf  




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