From: Kurt Zeilenga Date: Wed, 22 Nov 2000 20:27:30 +0000 (+0000) Subject: ITS#889 fix X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1643 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c0f9ec5458e0b6f14cfc0257eaeddbd6de96dc6a;p=openldap ITS#889 fix --- diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 9df35ac888..904fb0af08 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -329,9 +329,16 @@ ldap_int_open_connection( if (ld->ld_options.ldo_tls_mode == LDAP_OPT_X_TLS_HARD || strcmp( srv->lud_scheme, "ldaps" ) == 0 ) { + LDAPConn *savedefconn = ld->ld_defconn; + ++conn->lconn_refcnt; /* avoid premature free */ + ld->ld_defconn = conn; + rc = ldap_pvt_tls_start( ld, conn->lconn_sb, ld->ld_options.ldo_tls_ctx ); + ld->ld_defconn = savedefconn; + --conn->lconn_refcnt; + if (rc != LDAP_SUCCESS) { return -1; }