From a2d0baa2d931feae7f820d4594528894fd4a46cb Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Sun, 14 Feb 2016 18:44:30 +0100 Subject: GH678: Add a few more zalloc Remove some duplicated NULL/zero init. Signed-off-by: Rich Salz Reviewed-by: Tim Hudson --- crypto/evp/p_lib.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'crypto/evp') 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); } -- cgit v1.2.3