From: Howard Chu Date: Fri, 7 Apr 2006 01:13:31 +0000 (+0000) Subject: Bump SSL_CTX refcount whenever it gets retrieved X-Git-Tag: OPENLDAP_REL_ENG_2_4_0ALPHA~23 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7709d4d89e777a854f39e3e59dcab887775589b0;p=openldap Bump SSL_CTX refcount whenever it gets retrieved --- diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 2ba33970f1..6bf4fd3c88 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -1245,6 +1245,10 @@ ldap_pvt_tls_get_option( LDAP *ld, int option, void *arg ) break; case LDAP_OPT_X_TLS_CTX: *(void **)arg = lo->ldo_tls_ctx; + if ( lo->ldo_tls_ctx ) { + SSL_CTX *ctx = lo->ldo_tls_ctx; + CRYPTO_add( &ctx->references, 1, CRYPTO_LOCK_SSL_CTX ); + } break; case LDAP_OPT_X_TLS_CACERTFILE: *(char **)arg = lo->ldo_tls_cacertfile ?