mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
xmlFree() crashes on Windows so try calling free() instead, which works
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/nsxml_using_libxml2@34871 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
abf25f6fa3
commit
894e266ec8
2 changed files with 41 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-03-03 Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/NSXMLNode.m: xmlFree() crashes on Windows so try calling
|
||||
free() instead, which works.
|
||||
|
||||
2012-02-27 Doug Simons <doug.simons@testplant.com>
|
||||
|
||||
* Source/NSXMLNode.m: Fix a crashing bug after an invalid xpath
|
||||
|
|
|
@ -74,12 +74,22 @@ BOOL isEqualAttr(const xmlAttrPtr attrA, const xmlAttrPtr attrB)
|
|||
|
||||
if (xmlStrcmp(contentA, contentB) == 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
free(contentA);
|
||||
free(contentB);
|
||||
#else
|
||||
xmlFree(contentA);
|
||||
xmlFree(contentB);
|
||||
#endif
|
||||
return YES;
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
free(contentA);
|
||||
free(contentB);
|
||||
#else
|
||||
xmlFree(contentA);
|
||||
xmlFree(contentB);
|
||||
#endif
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -147,12 +157,22 @@ BOOL isEqualNode(xmlNodePtr nodeA, xmlNodePtr nodeB)
|
|||
contentB = xmlNodeGetContent((const xmlNodePtr)nodeB);
|
||||
if (xmlStrcmp(contentA, contentB) != 0)
|
||||
{
|
||||
#ifdef __MINGW32__
|
||||
free(contentA);
|
||||
free(contentB);
|
||||
#else
|
||||
xmlFree(contentA);
|
||||
xmlFree(contentB);
|
||||
#endif
|
||||
return NO;
|
||||
}
|
||||
#ifdef __MINGW32__
|
||||
free(contentA);
|
||||
free(contentB);
|
||||
#else
|
||||
xmlFree(contentA);
|
||||
xmlFree(contentB);
|
||||
#endif
|
||||
}
|
||||
|
||||
return YES;
|
||||
|
@ -576,7 +596,11 @@ int register_namespaces(xmlXPathContextPtr xpathCtx,
|
|||
if (next == NULL)
|
||||
{
|
||||
NSLog(@"Error: invalid namespaces list format");
|
||||
#ifdef __MINGW32__
|
||||
free(nsListDup);
|
||||
#else
|
||||
xmlFree(nsListDup);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
*(next++) = '\0';
|
||||
|
@ -594,12 +618,20 @@ int register_namespaces(xmlXPathContextPtr xpathCtx,
|
|||
{
|
||||
NSLog(@"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"",
|
||||
prefix, href);
|
||||
#ifdef __MINGW32__
|
||||
free(nsListDup);
|
||||
#else
|
||||
xmlFree(nsListDup);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __MINGW32__
|
||||
free(nsListDup);
|
||||
#else
|
||||
xmlFree(nsListDup);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1366,11 @@ NSArray *execute_xpath(NSXMLNode *xmlNode,
|
|||
*/
|
||||
|
||||
result = StringFromXMLStringPtr(content);
|
||||
#ifdef __MINGW32__
|
||||
free(content);
|
||||
#else
|
||||
xmlFree(content);
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue