Commit 14d465de authored by Daniel Veillard's avatar Daniel Veillard

check some allocation with Ashwin patch Daniel

* threads.c: check some allocation with Ashwin patch
Daniel

svn path=/trunk/; revision=3711
parent 24d87d94
Mon Mar 24 12:12:00 CET 2008 Daniel Veillard <daniel@veillard.com>
* threads.c: check some allocation with Ashwin patch
Wed Mar 19 16:41:52 CET 2008 Daniel Veillard <daniel@veillard.com>
* vms/build_libxml.com: update from Tycho Hilhorst, should fix #523378
......
......@@ -504,7 +504,9 @@ __xmlGlobalInitMutexUnlock(void)
#ifdef HAVE_PTHREAD_H
pthread_mutex_unlock(&global_init_lock);
#elif defined HAVE_WIN32_THREADS
LeaveCriticalSection(global_init_lock);
if (global_init_lock != NULL) {
LeaveCriticalSection(global_init_lock);
}
#elif defined HAVE_BEOS_THREADS
release_sem(global_init_lock);
#endif
......@@ -657,6 +659,8 @@ xmlGetGlobalState(void)
if ((globalval = (xmlGlobalState *)
pthread_getspecific(globalkey)) == NULL) {
xmlGlobalState *tsd = xmlNewGlobalState();
if (tsd == NULL)
return(NULL);
pthread_setspecific(globalkey, tsd);
return (tsd);
......@@ -720,9 +724,10 @@ xmlGetGlobalState(void)
xmlOnceInit();
if ((globalval = (xmlGlobalState *)
tls_get(globalkey)) == NULL) {
if ((globalval = (xmlGlobalState *) tls_get(globalkey)) == NULL) {
xmlGlobalState *tsd = xmlNewGlobalState();
if (tsd == NULL)
return (NULL);
tls_set(globalkey, tsd);
on_exit_thread(xmlGlobalStateCleanup, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment