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 /crypto/async | |
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 'crypto/async')
-rw-r--r-- | crypto/async/async.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/async/async.c b/crypto/async/async.c index 7678b489b3..5fb906e611 100644 --- a/crypto/async/async.c +++ b/crypto/async/async.c @@ -336,14 +336,12 @@ int ASYNC_init_thread(size_t max_size, size_t init_size) return 0; } - pool->jobs = sk_ASYNC_JOB_new_null(); + pool->jobs = sk_ASYNC_JOB_new_reserve(NULL, init_size); if (pool->jobs == NULL) { ASYNCerr(ASYNC_F_ASYNC_INIT_THREAD, ERR_R_MALLOC_FAILURE); OPENSSL_free(pool); return 0; } - if (!sk_ASYNC_JOB_reserve(pool->jobs, init_size)) - goto err; pool->max_size = max_size; |