]> git.sur5r.net Git - openldap/commitdiff
ITS#2486: plug leak
authorKurt Zeilenga <kurt@openldap.org>
Mon, 5 May 2003 17:35:59 +0000 (17:35 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 5 May 2003 17:35:59 +0000 (17:35 +0000)
libraries/libldap/tls.c

index d7d62885e02b612b386eb4b2c0003d6859be9685..6ce60d3bd79ce2c39e72bb5ec148124e4c54675e 100644 (file)
@@ -1711,9 +1711,6 @@ ldap_start_tls_s ( LDAP *ld,
 
        rc = ldap_extended_operation_s( ld, LDAP_EXOP_START_TLS,
                NULL, serverctrls, clientctrls, &rspoid, &rspdata );
-       if ( rc != LDAP_SUCCESS ) {
-               return rc;
-       }
 
        if ( rspoid != NULL ) {
                LDAP_FREE(rspoid);
@@ -1723,7 +1720,10 @@ ldap_start_tls_s ( LDAP *ld,
                ber_bvfree( rspdata );
        }
 
-       rc = ldap_int_tls_start( ld, ld->ld_defconn, NULL );
+       if ( rc != LDAP_SUCCESS ) {
+               rc = ldap_int_tls_start( ld, ld->ld_defconn, NULL );
+       }
+
 #else
        rc = LDAP_NOT_SUPPORTED;
 #endif