]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldap/unbind.c
Zero out op2
[openldap] / servers / slapd / back-ldap / unbind.c
index dbed6f577b65410b1bb173477adbd69f8c14d2fc..17d0bb763b740b41eaacc20d4d161e6269047d82 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2004 The OpenLDAP Foundation.
+ * Copyright 1999-2005 The OpenLDAP Foundation.
  * Portions Copyright 1999-2003 Howard Chu.
  * Portions Copyright 2000-2003 Pierangelo Masarati.
  * All rights reserved.
@@ -25,6 +25,7 @@
 
 #include <stdio.h>
 
+#include <ac/errno.h>
 #include <ac/socket.h>
 #include <ac/string.h>
 
@@ -53,8 +54,10 @@ ldap_back_conn_destroy(
 
        if ( lc ) {
                Debug( LDAP_DEBUG_TRACE,
-                       "=>ldap_back_conn_destroy: destroying conn %ld\n",
-                       lc->lc_conn->c_connid, 0, 0 );
+                       "=>ldap_back_conn_destroy: destroying conn %ld (refcnt=%u)\n",
+                       lc->lc_conn->c_connid, lc->lc_refcnt, 0 );
+
+               assert( lc->lc_refcnt == 0 );
 
                /*
                 * Needs a test because the handler may be corrupted,