]> git.sur5r.net Git - openldap/commitdiff
fix yet another leak
authorPierangelo Masarati <ando@openldap.org>
Tue, 19 Jul 2005 11:16:24 +0000 (11:16 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 19 Jul 2005 11:16:24 +0000 (11:16 +0000)
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/conn.c
servers/slapd/back-meta/unbind.c

index a3d67e4595c7dd02c1225d6996eed9dab7cc2302..23b85e3f064345b064422eb036db39ca3020225f 100644 (file)
@@ -276,9 +276,10 @@ retry_lock:;
                                        msc->msc_ld = NULL;
                                        msc->msc_bound = 0;
 
-                                       /* mc here must be the regular mc, reset and ready for init */
-                                       rc = meta_back_init_one_conn( op, rs, mt, msc,
-                                                       LDAP_BACK_DONTSEND );
+                                       /* mc here must be the regular mc,
+                                        * reset and ready for init */
+                                       rc = meta_back_init_one_conn( op, rs,
+                                               mt, msc, LDAP_BACK_DONTSEND );
 
                                } else {
                                        /* can't do anything about it */
@@ -448,8 +449,10 @@ retry_lock:;
                                        msc->msc_ld = NULL;
                                        msc->msc_bound = 0;
 
-                                       /* mc here must be the regular mc, reset and ready for init */
-                                       rc = meta_back_init_one_conn( op, rs, mt, msc, LDAP_BACK_DONTSEND );
+                                       /* mc here must be the regular mc,
+                                        * reset and ready for init */
+                                       rc = meta_back_init_one_conn( op, rs,
+                                               mt, msc, LDAP_BACK_DONTSEND );
                                
 
                                } else {
index 36fdc72a46fb79dfab81bc317f28f19705c9f6ae..d31363de5631c6a18c70fe568fb262b218f184b2 100644 (file)
@@ -217,8 +217,7 @@ meta_back_init_one_conn(
         * Already init'ed
         */
        if ( msc->msc_ld != NULL ) {
-               rs->sr_err = LDAP_SUCCESS;
-               goto error_return;
+               return rs->sr_err = LDAP_SUCCESS;
        }
        
        /*
@@ -242,14 +241,14 @@ meta_back_init_one_conn(
        }
 
 #ifdef HAVE_TLS
-       /* start TLS ("start-tls"/"try-start-tls" statements) */
+       /* start TLS ("tls [try-]{start|propagate}" statement) */
        if ( ( LDAP_BACK_USE_TLS( mi ) || ( op->o_conn->c_is_tls && LDAP_BACK_PROPAGATE_TLS( mi ) ) )
                        && !ldap_is_ldaps_url( mt->mt_uri ) )
        {
 #ifdef SLAP_STARTTLS_ASYNCHRONOUS
                /*
-                * use asynchronous StartTLS
-                * in case, chase referral (not implemented yet)
+                * use asynchronous StartTLS; in case, chase referral
+                * FIXME: OpenLDAP does not return referral on StartTLS yet
                 */
                int             msgid;
 
@@ -345,11 +344,6 @@ retry:;
                                (void *)&network_timeout );
        }
 
-       /*
-        * Sets a cookie for the rewrite session
-        */
-       ( void )rewrite_session_init( mt->mt_rwmap.rwm_rw, op->o_conn );
-
        /*
         * If the connection DN is not null, an attempt to rewrite it is made
         */
@@ -382,7 +376,13 @@ retry:;
        msc->msc_bound = META_UNBOUND;
 
 error_return:;
-       if ( rs->sr_err != LDAP_SUCCESS ) {
+       if ( rs->sr_err == LDAP_SUCCESS ) {
+               /*
+                * Sets a cookie for the rewrite session
+                */
+               ( void )rewrite_session_init( mt->mt_rwmap.rwm_rw, op->o_conn );
+
+       } else {
                rs->sr_err = slap_map_api2result( rs );
                if ( sendok & LDAP_BACK_SENDERR ) {
                        send_ldap_result( op, rs );
index aedf29a5a6dbdd6d46a561f61a70006392fd8559..e3d8a60421e3ea368d94fb9d974f812788e6e694 100644 (file)
@@ -90,8 +90,6 @@ retry_lock:;
                rewrite_session_delete( mi->mi_targets[ i ].mt_rwmap.rwm_rw, conn );
        }
 
-       /* no response to unbind */
-
        return 0;
 }