]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/alock.c
Plug mutex/rwlock leaks (destroy them)
[openldap] / servers / slapd / alock.c
index 9c4fd72f5c79e64dbaf5acfa8092f3583e17b5f3..5fa0704105661bdf46b00516b5aa8d2cacb16f44 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2005-2009 The OpenLDAP Foundation.
+ * Copyright 2005-2010 The OpenLDAP Foundation.
  * Portions Copyright 2004-2005 Symas Corporation.
  * All rights reserved.
  *
@@ -409,7 +409,8 @@ alock_open ( alock_info_t * info,
                                ++live_count;
 
                        } else if (res == ALOCK_UNIQUE
-                               && locktype == ALOCK_UNIQUE) {
+                               && (( locktype & ALOCK_SMASK ) == ALOCK_UNIQUE
+                               || nosave )) {
                                close (info->al_fd);
                                ber_memfree (slot_data.al_appname);
                                return ALOCK_BUSY;