fixes some problem when freeing unititialized mutexes Daniel
* globals.c threads.c: fixes some problem when freeing unititialized
mutexes
Daniel
diff --git a/ChangeLog b/ChangeLog
index 6758cf3..a393ecf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Jul 8 16:02:19 CEST 2003 Daniel Veillard <daniel@veillard.com>
+
+ * globals.c threads.c: fixes some problem when freeing unititialized
+ mutexes
+
Tue Jul 8 14:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com>
* nanoftp.c nanohttp.c: the modules should not import <config.h>
diff --git a/globals.c b/globals.c
index ee6417b..811160f 100644
--- a/globals.c
+++ b/globals.c
@@ -46,7 +46,8 @@
void xmlCleanupGlobals()
{
- xmlFreeMutex(xmlThrDefMutex);
+ if (xmlThrDefMutex != NULL)
+ xmlFreeMutex(xmlThrDefMutex);
}
/************************************************************************
diff --git a/threads.c b/threads.c
index 777339c..3a879fc 100644
--- a/threads.c
+++ b/threads.c
@@ -134,6 +134,8 @@
void
xmlFreeMutex(xmlMutexPtr tok)
{
+ if (tok == NULL) return;
+
#ifdef HAVE_PTHREAD_H
pthread_mutex_destroy(&tok->lock);
#elif defined HAVE_WIN32_THREADS