]> git.sur5r.net Git - openldap/commitdiff
ITS#5934 fix NULL pointer deref
authorHoward Chu <hyc@openldap.org>
Mon, 9 Feb 2009 21:14:46 +0000 (21:14 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 9 Feb 2009 21:14:46 +0000 (21:14 +0000)
libraries/libldap/request.c

index 797dc2c3d030e3acf7dc3d94775c25246169928a..0fdf5c9794b755b9a30b7de27b99b3ffcc9aa5ea 100644 (file)
@@ -452,9 +452,9 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb,
        ldap_pvt_thread_mutex_unlock( &ld->ld_conn_mutex );
 #endif
 
-       if ( lc->lconn_server->lud_exts ) {
+       if ( connect ) {
 #ifdef HAVE_TLS
-               if ( connect ) {
+               if ( lc->lconn_server->lud_exts ) {
                        int rc, ext = find_tls_ext( lc->lconn_server );
                        if ( ext ) {
                                LDAPConn        *savedefconn;
@@ -480,7 +480,6 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc **srvlist, int use_ldsb,
                                        return NULL;
                                }
                        }
-                       
                }
 #endif
        }