]> git.sur5r.net Git - openldap/commitdiff
(partial?) fix ITS#3808
authorPierangelo Masarati <ando@openldap.org>
Wed, 29 Jun 2005 11:44:11 +0000 (11:44 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 29 Jun 2005 11:44:11 +0000 (11:44 +0000)
servers/slapd/back-ldap/bind.c

index ce991e476c96b8e84ebf505a1efe4d04827f0a13..b817be965a728d073127efae642b746b71f0c40e 100644 (file)
@@ -212,14 +212,21 @@ int
 ldap_back_freeconn( Operation *op, struct ldapconn *lc )
 {
        struct ldapinfo *li = (struct ldapinfo *) op->o_bd->be_private;
+       int             rc = 0;
 
        ldap_pvt_thread_mutex_lock( &li->conn_mutex );
        lc = avl_delete( &li->conntree, (caddr_t)lc,
                        ldap_back_conn_cmp );
-       ldap_back_conn_free( (void *)lc );
+       if ( lc == NULL ) {
+               /* something BAD happened */
+               rc = -1;
+
+       } else {
+               ldap_back_conn_free( (void *)lc );
+       }
        ldap_pvt_thread_mutex_unlock( &li->conn_mutex );
 
-       return 0;
+       return rc;
 }
 
 static int