Commit 8985cde7 authored by Martin von Gagern's avatar Martin von Gagern Committed by Daniel Veillard

xmlMemUsed is not thread-safe

For https://bugzilla.gnome.org/show_bug.cgi?id=747437
just use the mutex to protect access to those variables
parent 7607d9dd
......@@ -554,7 +554,12 @@ xmlMemoryStrdup(const char *str) {
int
xmlMemUsed(void) {
return(debugMemSize);
int res;
xmlMutexLock(xmlMemMutex);
res = debugMemSize;
xmlMutexUnlock(xmlMemMutex);
return(res);
}
/**
......@@ -567,7 +572,12 @@ xmlMemUsed(void) {
int
xmlMemBlocks(void) {
return(debugMemBlocks);
int res;
xmlMutexLock(xmlMemMutex);
res = debugMemBlocks;
xmlMutexUnlock(xmlMemMutex);
return(res);
}
#ifdef MEM_LIST
......
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