Set reference count earlier

Backport of 0e04674e96

Reviewed-by: Steve Henson <steve@openssl.org>

RT #4047, #4110, MR #1356
This commit is contained in:
Kurt Roeckx
2015-11-23 00:07:28 +01:00
parent 943c4ca62b
commit 3a9328e3f7
2 changed files with 2 additions and 2 deletions

View File

@@ -307,6 +307,7 @@ SSL *SSL_new(SSL_CTX *ctx)
s->options = ctx->options;
s->mode = ctx->mode;
s->max_cert_list = ctx->max_cert_list;
s->references = 1;
if (ctx->cert != NULL) {
/*
@@ -405,7 +406,6 @@ SSL *SSL_new(SSL_CTX *ctx)
if (!s->method->ssl_new(s))
goto err;
s->references = 1;
s->server = (ctx->method->ssl_accept == ssl_undefined_function) ? 0 : 1;
SSL_clear(s);