From: Howard Chu Date: Fri, 23 May 2008 09:53:42 +0000 (+0000) Subject: ITS#5518,#5525 cleanup ld_defconn if it was freed X-Git-Tag: LOCKER_IDS~154 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=96550c885d0eed1a7cade3efda903ff035a7639e;p=openldap ITS#5518,#5525 cleanup ld_defconn if it was freed --- diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index 9894301b88..31d72ca0e2 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -631,6 +631,9 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) } else { prevlc->lconn_next = tmplc->lconn_next; } + if ( ld->ld_defconn == lc ) { + ld->ld_defconn = NULL; + } break; } prevlc = tmplc; @@ -675,6 +678,8 @@ ldap_free_connection( LDAP *ld, LDAPConn *lc, int force, int unbind ) if ( lc->lconn_sb != ld->ld_sb ) { ber_sockbuf_free( lc->lconn_sb ); + } else { + ber_int_sb_close( lc->lconn_sb ); } if ( lc->lconn_rebind_queue != NULL) {