]> git.sur5r.net Git - openldap/commitdiff
ITS#5976 check for cert/DN
authorHoward Chu <hyc@openldap.org>
Wed, 25 Feb 2009 21:48:10 +0000 (21:48 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 25 Feb 2009 21:48:10 +0000 (21:48 +0000)
libraries/libldap/tls2.c

index 33ebd7063149d6b541089ad4f608d93fcaf7811d..642cc118ebc88a17a026abdebb1e5feca6b4b3d6 100644 (file)
@@ -872,8 +872,9 @@ ldap_pvt_tls_get_my_dn( void *s, struct berval *dn, LDAPDN_rewrite_dummy *func,
        struct berval der_dn;
        int rc;
 
-       tls_imp->ti_session_my_dn( session, &der_dn );
-       rc = ldap_X509dn2bv(&der_dn, dn, (LDAPDN_rewrite_func *)func, flags );
+       rc = tls_imp->ti_session_my_dn( session, &der_dn );
+       if ( rc == LDAP_SUCCESS )
+               rc = ldap_X509dn2bv(&der_dn, dn, (LDAPDN_rewrite_func *)func, flags );
        return rc;
 }
 #endif /* HAVE_TLS */