Use xmlFreeNsList to deallocate xmlNsPtr

Previously xmlFree only freed the top-level allocation and not the entire
linked list.  Multiple namespaces should be rare but perhaps some S3
implementations have both a global and local namespace.  The xmlFree(void*)
prototype hid the type mismatch.
This commit is contained in:
Andrew Gaul 2024-03-05 18:31:09 +09:00 committed by Andrew Gaul
parent 70a30d6e26
commit ea8109bce0
2 changed files with 1 additions and 6 deletions

View File

@ -64,11 +64,6 @@
xmlFreeDoc(doc); \
S3FS_MALLOCTRIM(0); \
}while(0)
#define S3FS_XMLFREE(ptr) \
do{ \
xmlFree(ptr); \
S3FS_MALLOCTRIM(0); \
}while(0)
#define S3FS_XMLXPATHFREECONTEXT(ctx) \
do{ \
xmlXPathFreeContext(ctx); \

View File

@ -73,7 +73,7 @@ static bool GetXmlNsUrl(xmlDocPtr doc, std::string& nsurl)
strNs = std::string(reinterpret_cast<const char*>(nslist[0]->href), len);
}
}
S3FS_XMLFREE(nslist);
xmlFreeNsList(*nslist);
}
}
}