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