Don't check for malloc failure twice.
authorDavid Benjamin <davidben@google.com>
Sat, 20 Aug 2016 17:55:17 +0000 (13:55 -0400)
committerKurt Roeckx <kurt@roeckx.be>
Mon, 22 Aug 2016 19:20:31 +0000 (21:20 +0200)
a03f81f4ead24c234dc26e388d86a352685f3948 added a malloc failure check to
EVP_PKEY_keygen, but there already was one.

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1473

crypto/evp/pmeth_gn.c

index 6d7b5d724214e70f2fbc0801c4b9bb8857f2ae7c..6a4d3573ff7673314d45dd05c68abf19840184df 100644 (file)
@@ -154,11 +154,6 @@ int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
     if (*ppkey == NULL)
         return -1;
 
-    if (*ppkey == NULL) {
-        EVPerr(EVP_F_EVP_PKEY_KEYGEN, ERR_R_MALLOC_FAILURE);
-        return -1;
-    }
-
     ret = ctx->pmeth->keygen(ctx, *ppkey);
     if (ret <= 0) {
         EVP_PKEY_free(*ppkey);