1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

runtest: Allow catalogs

It's enough to disable the system catalog to avoid unwanted allocations.
This commit is contained in:
Nick Wellnhofer 2024-06-15 19:37:27 +02:00
parent 208f27f964
commit 6ed39a82c6

View File

@ -266,13 +266,16 @@ initializeLibxml2(void) {
xmlInitParser();
xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup);
#ifdef LIBXML_CATALOG_ENABLED
/*
* Disable system catalog which could cause lazy memory allocations
* resulting in false positive memory leaks.
*/
#ifdef _WIN32
putenv("XML_CATALOG_FILES=");
#else
setenv("XML_CATALOG_FILES", "", 1);
#endif
xmlInitializeCatalog();
xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
xmlSchemaInitTypes();
@ -4326,13 +4329,7 @@ threadsTest(const char *filename ATTRIBUTE_UNUSED,
const char *resul ATTRIBUTE_UNUSED,
const char *err ATTRIBUTE_UNUSED,
int options ATTRIBUTE_UNUSED) {
int ret;
xmlCatalogSetDefaults(XML_CATA_ALLOW_ALL);
ret = testThread();
xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
return(ret);
return(testThread());
}
#endif