free cleanup almost the finale
[openssl.git] / crypto / asn1 / a_verify.c
index 6023b148f06427b18ff02891b91263b363131ed7..b452999756bd96cc47b095d53120e2d5ddccef58 100644 (file)
@@ -107,8 +107,7 @@ int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
     ret = EVP_VerifyInit_ex(&ctx, type, NULL)
         && EVP_VerifyUpdate(&ctx, (unsigned char *)buf_in, inl);
 
-    OPENSSL_cleanse(buf_in, (unsigned int)inl);
-    OPENSSL_free(buf_in);
+    OPENSSL_clear_free(buf_in, (unsigned int)inl);
 
     if (!ret) {
         ASN1err(ASN1_F_ASN1_VERIFY, ERR_R_EVP_LIB);
@@ -208,8 +207,7 @@ int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
 
     ret = EVP_DigestVerifyUpdate(&ctx, buf_in, inl);
 
-    OPENSSL_cleanse(buf_in, (unsigned int)inl);
-    OPENSSL_free(buf_in);
+    OPENSSL_clear_free(buf_in, (unsigned int)inl);
 
     if (!ret) {
         ASN1err(ASN1_F_ASN1_ITEM_VERIFY, ERR_R_EVP_LIB);