aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/dh/dh_pmeth.c
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/crypto/dh/dh_pmeth.c')
-rw-r--r--openssl/crypto/dh/dh_pmeth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openssl/crypto/dh/dh_pmeth.c b/openssl/crypto/dh/dh_pmeth.c
index 494a887de..b3a31472a 100644
--- a/openssl/crypto/dh/dh_pmeth.c
+++ b/openssl/crypto/dh/dh_pmeth.c
@@ -462,6 +462,9 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
ret = 0;
Zlen = DH_size(dh);
Z = OPENSSL_malloc(Zlen);
+ if(!Z) {
+ goto err;
+ }
if (DH_compute_key_padded(Z, dhpub, dh) <= 0)
goto err;
if (!DH_KDF_X9_42(key, *keylen, Z, Zlen, dctx->kdf_oid,