[libxml2] fix: avoid segfault at exit when using custom memory functions



commit a7b9f3ebdfc761d6f21c83cab976f785633bf75f
Author: Mike Dalessio <mike dalessio gmail com>
Date:   Thu May 20 13:38:54 2021 -0400

    fix: avoid segfault at exit when using custom memory functions
    
    This extends the fix introduced by 956534e to Windows processes
    dynamically loading libxml2.
    
    Closes #256.

 parser.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/parser.c b/parser.c
index c9312fa4..255bd254 100644
--- a/parser.c
+++ b/parser.c
@@ -14672,7 +14672,8 @@ xmlInitParser(void) {
        return;
 
 #if defined(_WIN32) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
-       atexit(xmlCleanupParser);
+    if (xmlFree == free)
+        atexit(xmlCleanupParser);
 #endif
 
 #ifdef LIBXML_THREAD_ENABLED


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]