X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fevp%2Fp_open.c;h=481c85518a6c5dd510b32cf646f127f7f57a6815;hb=b548a1f11c06ccdfa4f52a539912d22d77ee309e;hp=229eb6417af87235138056e2d38957b035cbb3de;hpb=0f113f3ee4d629ef9a4a30911b22b224772085e5;p=oweals%2Fopenssl.git diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c index 229eb6417a..481c85518a 100644 --- a/crypto/evp/p_open.c +++ b/crypto/evp/p_open.c @@ -88,7 +88,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, } size = RSA_size(priv->pkey.rsa); - key = (unsigned char *)OPENSSL_malloc(size + 2); + key = OPENSSL_malloc(size + 2); if (key == NULL) { /* ERROR */ EVPerr(EVP_F_EVP_OPENINIT, ERR_R_MALLOC_FAILURE); @@ -105,9 +105,7 @@ int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, ret = 1; err: - if (key != NULL) - OPENSSL_cleanse(key, size); - OPENSSL_free(key); + OPENSSL_clear_free(key, size); return (ret); }