]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/open.c
ITS#6689
[openldap] / libraries / libldap / open.c
index 85a22be4fc6c96561146495e2dadd7c64436333d..1bc86e39a718d160eee2a8f03180bb135328b5c7 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2009 The OpenLDAP Foundation.
+ * Copyright 1998-2010 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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 */