diff options
author | Paul Yang <yang.yang@baishancloud.com> | 2017-10-27 01:56:14 +0800 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-10-26 14:34:35 -0400 |
commit | 7a908204ed3afe1379151c6d090148edb2fcc87e (patch) | |
tree | c59897274c934708a1c630cba56748d784e3c4b7 /ssl/ssl_lib.c | |
parent | 689c17883ac20d0991427b822eb98d2f0e6b78e7 (diff) |
Simplify the stack reservation
Use the newly introduced sk_TYPE_new_reserve API to simplify the
reservation of stack as creating it.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4592)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 0df69b4da6..4435efdb0c 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -164,14 +164,12 @@ static int ssl_dane_dup(SSL *to, SSL *from) dane_final(&to->dane); to->dane.flags = from->dane.flags; to->dane.dctx = &to->ctx->dane; - to->dane.trecs = sk_danetls_record_new_null(); + to->dane.trecs = sk_danetls_record_new_reserve(NULL, num); if (to->dane.trecs == NULL) { SSLerr(SSL_F_SSL_DANE_DUP, ERR_R_MALLOC_FAILURE); return 0; } - if (!sk_danetls_record_reserve(to->dane.trecs, num)) - return 0; for (i = 0; i < num; ++i) { danetls_record *t = sk_danetls_record_value(from->dane.trecs, i); |