From 7709d4d89e777a854f39e3e59dcab887775589b0 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 7 Apr 2006 01:13:31 +0000 Subject: [PATCH] Bump SSL_CTX refcount whenever it gets retrieved --- libraries/libldap/tls.c | 4 ++++ 1 file changed, 4 insertions(+) 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 ? -- 2.39.5