Fix a crashing bug after an invalid xpath expression is used

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34839 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2012-02-28 03:22:23 +00:00
parent ef4da2c593
commit abf25f6fa3
2 changed files with 6 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2012-02-27 Doug Simons <doug.simons@testplant.com>
* Source/NSXMLNode.m: Fix a crashing bug after an invalid xpath
expression is used.
2012-02-27 Doug Simons <doug.simons@testplant.com>
* Source/NSXMLNode.m:

View file

@ -647,8 +647,7 @@ NSArray *execute_xpath(NSXMLNode *xmlNode,
if (xpathObj == NULL)
{
NSLog(@"Error: unable to evaluate xpath expression \"%s\"", xpathExpr);
xmlXPathFreeContext(xpathCtx);
xmlFreeDoc(doc);
xmlXPathFreeContext(xpathCtx);
return nil;
}