]> git.sur5r.net Git - openldap/commitdiff
More for prev commit - only set if URL was provided.
authorHoward Chu <hyc@openldap.org>
Wed, 18 Nov 2009 22:37:02 +0000 (22:37 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 18 Nov 2009 22:37:02 +0000 (22:37 +0000)
(should URL be mandatory?)

libraries/libldap/open.c

index 85a22be4fc6c96561146495e2dadd7c64436333d..8b6942d31b06a3ed05a3f76f3610586e18be742d 100644 (file)
@@ -271,7 +271,8 @@ ldap_init_fd(
                ldap_unbind_ext( ld, NULL, NULL );
                return( LDAP_NO_MEMORY );
        }
-       conn->lconn_server = ldap_url_dup( ld->ld_options.ldo_defludp );
+       if( url )
+               conn->lconn_server = ldap_url_dup( ld->ld_options.ldo_defludp );
        ber_sockbuf_ctrl( conn->lconn_sb, LBER_SB_OPT_SET_FD, &fd );
        ld->ld_defconn = conn;
        ++ld->ld_defconn->lconn_refcnt; /* so it never gets closed/freed */