diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-02-14 18:44:30 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-22 12:13:37 -0500 |
commit | a2d0baa2d931feae7f820d4594528894fd4a46cb (patch) | |
tree | e576be98f17420e99d670380470be080441c6a31 /crypto/evp | |
parent | cbb259caaf2cabf9bedc35fd41ba84f048a3de0f (diff) |
GH678: Add a few more zalloc
Remove some duplicated NULL/zero init.
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/p_lib.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 1f9f6f010f..221178dd31 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c @@ -186,9 +186,8 @@ int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b) EVP_PKEY *EVP_PKEY_new(void) { - EVP_PKEY *ret; + EVP_PKEY *ret = OPENSSL_zalloc(sizeof(*ret)); - ret = OPENSSL_malloc(sizeof(*ret)); if (ret == NULL) { EVPerr(EVP_F_EVP_PKEY_NEW, ERR_R_MALLOC_FAILURE); return (NULL); @@ -196,10 +195,6 @@ EVP_PKEY *EVP_PKEY_new(void) ret->type = EVP_PKEY_NONE; ret->save_type = EVP_PKEY_NONE; ret->references = 1; - ret->ameth = NULL; - ret->engine = NULL; - ret->pkey.ptr = NULL; - ret->attributes = NULL; ret->save_parameters = 1; return (ret); } |