mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
* Source/NSXMLNode.m: Fix a crashing bug after an invalid xpath
expression is used. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@34848 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b6015d2f0a
commit
8916922c6d
2 changed files with 11 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -937,12 +936,15 @@ NSArray *execute_xpath(NSXMLNode *xmlNode,
|
|||
- (id) copyWithZone: (NSZone*)zone
|
||||
{
|
||||
id c = [[self class] allocWithZone: zone];
|
||||
// make a deep copy
|
||||
xmlNodePtr newNode = xmlCopyNode([self _node], 2);
|
||||
xmlNodePtr newNode = xmlCopyNode([self _node], 1); // make a deep copy
|
||||
clearPrivatePointers(newNode);
|
||||
|
||||
//c = [c initWithKind: internal->kind options: internal->options];
|
||||
//[c _setNode: newNode];
|
||||
c = [c _initWithNode: newNode kind: internal->kind];
|
||||
|
||||
|
||||
|
||||
// [c setName: [self name]];
|
||||
// [c setURI: [self URI]];
|
||||
// [c setObjectValue: [self objectValue]];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue