aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/evp/pmeth_gn.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/pmeth_gn.c')
-rw-r--r--crypto/evp/pmeth_gn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c
index 6435f1b632cf..6a4d3573ff76 100644
--- a/crypto/evp/pmeth_gn.c
+++ b/crypto/evp/pmeth_gn.c
@@ -149,8 +149,10 @@ int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey)
if (!ppkey)
return -1;
- if (!*ppkey)
+ if (*ppkey == NULL)
*ppkey = EVP_PKEY_new();
+ if (*ppkey == NULL)
+ return -1;
ret = ctx->pmeth->keygen(ctx, *ppkey);
if (ret <= 0) {