]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/hmac/hm_pmeth.c
free cleanup almost the finale
[thirdparty/openssl.git] / crypto / hmac / hm_pmeth.c
index f2be144c8f7f46cf1629a60dea2f07f7e10d7d16..f53f78c8984f06417b3b5e1019712bf59d2ae619 100644 (file)
@@ -113,13 +113,9 @@ static int pkey_hmac_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
 static void pkey_hmac_cleanup(EVP_PKEY_CTX *ctx)
 {
     HMAC_PKEY_CTX *hctx = ctx->data;
+
     HMAC_CTX_cleanup(&hctx->ctx);
-    if (hctx->ktmp.data) {
-        if (hctx->ktmp.length)
-            OPENSSL_cleanse(hctx->ktmp.data, hctx->ktmp.length);
-        OPENSSL_free(hctx->ktmp.data);
-        hctx->ktmp.data = NULL;
-    }
+    OPENSSL_clear_free(hctx->ktmp.data, hctx->ktmp.length);
     OPENSSL_free(hctx);
 }