From f650c71ac056cf37db95f39b65d4d2fb5ee3d72d Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Thu, 22 Dec 2016 15:54:51 -0500 Subject: [PATCH] Use SSL_CTX_up_ref to up-ref an SSL_CTX. We have this function now. Probably good to use it. Change-Id: I00fe1f4cf5c8cb6f61a8f6600cac4667e95ad7f3 Reviewed-on: https://boringssl-review.googlesource.com/13040 Reviewed-by: David Benjamin Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- ssl/ssl_lib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 40477a90..806bdba8 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -419,9 +419,9 @@ SSL *SSL_new(SSL_CTX *ctx) { ssl->quiet_shutdown = ctx->quiet_shutdown; ssl->max_send_fragment = ctx->max_send_fragment; - CRYPTO_refcount_inc(&ctx->references); + SSL_CTX_up_ref(ctx); ssl->ctx = ctx; - CRYPTO_refcount_inc(&ctx->references); + SSL_CTX_up_ref(ctx); ssl->initial_ctx = ctx; if (ctx->supported_group_list) { @@ -2266,8 +2266,8 @@ SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx) { ssl_cert_free(ssl->cert); ssl->cert = ssl_cert_dup(ctx->cert); - CRYPTO_refcount_inc(&ctx->references); - SSL_CTX_free(ssl->ctx); /* decrement reference count */ + SSL_CTX_up_ref(ctx); + SSL_CTX_free(ssl->ctx); ssl->ctx = ctx; ssl->sid_ctx_length = ctx->sid_ctx_length;