]> git.sur5r.net Git - openldap/commitdiff
Bump SSL_CTX refcount whenever it gets retrieved
authorHoward Chu <hyc@openldap.org>
Fri, 7 Apr 2006 01:13:31 +0000 (01:13 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 7 Apr 2006 01:13:31 +0000 (01:13 +0000)
libraries/libldap/tls.c

index 2ba33970f1af18818edc33c7b512ab4ccaa2a75f..6bf4fd3c88232150bc4d7bf0b257548d0fe81206 100644 (file)
@@ -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 ?