X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fdh%2Fdh_pmeth.c;h=e3ebc0201d8670c7a1f904069dbed230d175e8c6;hp=3fad0548a13e88488fc4973f6c037776689fb205;hb=4b45c6e52b208deff7da333d1c7f84bcd3986609;hpb=68dc682499ea3fe27d909c946d7abd39062d6efd diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c index 3fad0548a1..e3ebc0201d 100644 --- a/crypto/dh/dh_pmeth.c +++ b/crypto/dh/dh_pmeth.c @@ -477,10 +477,7 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key, *keylen = dctx->kdf_outlen; ret = 1; err: - if (Z) { - OPENSSL_cleanse(Z, Zlen); - OPENSSL_free(Z); - } + OPENSSL_clear_free(Z, Zlen); return ret; } return 1;