Package: cyrus-sasl2 / 2.1.27+dfsg-1

0005-Fixes-in-library-mutexes.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: Debian Cyrus SASL Team
 <pkg-cyrus-sasl2-debian-devel@lists.alioth.debian.org>
Date: Thu, 24 Mar 2016 11:35:03 +0100
Subject: Fixes in library mutexes

---
 lib/common.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/common.c b/lib/common.c
index bc3bf1d..244d0f0 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -816,7 +816,7 @@ int _sasl_common_init(sasl_global_callbacks_t *global_callbacks)
     result = sasl_canonuser_add_plugin("INTERNAL", internal_canonuser_init);
     if(result != SASL_OK) return result;    
 
-    if (!free_mutex) {
+    if (!free_mutex || free_mutex == 0x1) {
 	free_mutex = sasl_MUTEX_ALLOC();
     }
     if (!free_mutex) return SASL_FAIL;
@@ -836,10 +836,10 @@ void sasl_dispose(sasl_conn_t **pconn)
 
   /* serialize disposes. this is necessary because we can't
      dispose of conn->mutex if someone else is locked on it */
-  if (!free_mutex) {
+  if (!free_mutex || free_mutex == 0x1) {
       free_mutex = sasl_MUTEX_ALLOC();
-      if (!free_mutex) return;
   }
+  if (!free_mutex) return;
 
   result = sasl_MUTEX_LOCK(free_mutex);
   if (result!=SASL_OK) return;