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>
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c index 1f9f6f0..221178d 100644 --- a/crypto/evp/p_lib.c +++ b/crypto/evp/p_lib.c
@@ -186,9 +186,8 @@ 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 @@ 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); }