45ed318
diff -up cyrus-sasl-2.1.23/lib/common.c.race cyrus-sasl-2.1.23/lib/common.c
45ed318
--- cyrus-sasl-2.1.23/lib/common.c.race	2010-02-22 09:57:28.000000000 +0100
45ed318
+++ cyrus-sasl-2.1.23/lib/common.c	2010-02-22 09:59:30.000000000 +0100
45ed318
@@ -794,7 +794,11 @@ void sasl_dispose(sasl_conn_t **pconn)
45ed318
   if (result!=SASL_OK) return;
45ed318
   
45ed318
   /* *pconn might have become NULL by now */
45ed318
-  if (! (*pconn)) return;
45ed318
+  if (! (*pconn))
45ed318
+  {
45ed318
+	sasl_MUTEX_UNLOCK(free_mutex);
45ed318
+	return;
45ed318
+  }
45ed318
 
45ed318
   (*pconn)->destroy_conn(*pconn);
45ed318
   sasl_FREE(*pconn);