X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconnection.c;h=766ca439bf0ce53f5c10611bfe00a655a4ff1c87;hb=f8fb4aca7668c722f41941be719203aa8c298e12;hp=799c4adf7b014d09b7fb48868c0478f83043969d;hpb=029306a5bebdcfec1de9c85c1c5e72b276f3fac7;p=openldap diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 799c4adf7b..766ca439bf 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1,6 +1,6 @@ /* $OpenLDAP$ */ /* - * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ @@ -417,7 +417,8 @@ long connection_init( c->c_dn.bv_len = 0; c->c_ndn.bv_val = NULL; c->c_ndn.bv_len = 0; - c->c_cdn = NULL; + c->c_cdn.bv_val = NULL; + c->c_cdn.bv_len = 0; c->c_groups = NULL; c->c_listener_url = NULL; @@ -455,7 +456,7 @@ long connection_init( assert( c->c_authmech == NULL ); assert( c->c_dn.bv_val == NULL ); assert( c->c_ndn.bv_val == NULL ); - assert( c->c_cdn == NULL ); + assert( c->c_cdn.bv_val == NULL ); assert( c->c_groups == NULL ); assert( c->c_listener_url == NULL ); assert( c->c_peer_domain == NULL ); @@ -504,6 +505,8 @@ long connection_init( #endif ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_udp, LBER_SBIOD_LEVEL_PROVIDER, (void *)&s ); + ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_readahead, + LBER_SBIOD_LEVEL_PROVIDER, NULL ); } else #endif { @@ -514,8 +517,6 @@ long connection_init( ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_tcp, LBER_SBIOD_LEVEL_PROVIDER, (void *)&s ); } - ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_readahead, - LBER_SBIOD_LEVEL_PROVIDER, NULL ); #ifdef LDAP_DEBUG ber_sockbuf_add_io( c->c_sb, &ber_sockbuf_io_debug, @@ -591,10 +592,11 @@ void connection2anonymous( Connection *c ) } c->c_ndn.bv_len = 0; - if(c->c_cdn != NULL) { - free(c->c_cdn); - c->c_cdn = NULL; + if(c->c_cdn.bv_val != NULL) { + free(c->c_cdn.bv_val); + c->c_cdn.bv_val = NULL; } + c->c_cdn.bv_len = 0; c->c_authc_backend = NULL; c->c_authz_backend = NULL;