diff options
author | Aron Xu <aron@debian.org> | 2015-09-22 16:23:21 +0800 |
---|---|---|
committer | Aron Xu <aron@debian.org> | 2015-09-22 16:23:21 +0800 |
commit | fccd80a7d35b9eefabcc384d5c9fe89d9545dd22 (patch) | |
tree | ca656201cfb4fdfff588be659e83e25bd9b060ce /debian/patches/0009-xmlMemUsed-is-not-thread-safe.patch | |
parent | 08766acaa78dcf7b2174cca94d5e102f910df6dd (diff) | |
download | libxml2-fccd80a7d35b9eefabcc384d5c9fe89d9545dd22.tar.gz |
Upstream post release cherry-picks
Diffstat (limited to 'debian/patches/0009-xmlMemUsed-is-not-thread-safe.patch')
-rw-r--r-- | debian/patches/0009-xmlMemUsed-is-not-thread-safe.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/debian/patches/0009-xmlMemUsed-is-not-thread-safe.patch b/debian/patches/0009-xmlMemUsed-is-not-thread-safe.patch new file mode 100644 index 0000000..03a8f4f --- /dev/null +++ b/debian/patches/0009-xmlMemUsed-is-not-thread-safe.patch @@ -0,0 +1,42 @@ +From: Martin von Gagern <Martin.vGagern@gmx.net> +Date: Mon, 13 Apr 2015 16:32:14 +0800 +Subject: 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 +--- + xmlmemory.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/xmlmemory.c b/xmlmemory.c +index a3dc737..f24fd6d 100644 +--- a/xmlmemory.c ++++ b/xmlmemory.c +@@ -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 |