Commit 7709d4d8 authored by Howard Chu's avatar Howard Chu
Browse files

Bump SSL_CTX refcount whenever it gets retrieved

parent d18277ea
...@@ -1245,6 +1245,10 @@ ldap_pvt_tls_get_option( LDAP *ld, int option, void *arg ) ...@@ -1245,6 +1245,10 @@ ldap_pvt_tls_get_option( LDAP *ld, int option, void *arg )
break; break;
case LDAP_OPT_X_TLS_CTX: case LDAP_OPT_X_TLS_CTX:
*(void **)arg = lo->ldo_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; break;
case LDAP_OPT_X_TLS_CACERTFILE: case LDAP_OPT_X_TLS_CACERTFILE:
*(char **)arg = lo->ldo_tls_cacertfile ? *(char **)arg = lo->ldo_tls_cacertfile ?
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment