From 76e01c508481c7379a8a64645963bcdf6a96f20a Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Sun, 16 Aug 2009 20:42:38 +0200 Subject: [PATCH] (EVP_MD_CTX_cleanup): clean out memory --- lib/hcrypto/evp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/hcrypto/evp.c b/lib/hcrypto/evp.c index d65dfb7ef..3299ee0ed 100644 --- a/lib/hcrypto/evp.c +++ b/lib/hcrypto/evp.c @@ -176,6 +176,8 @@ EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) HC_DEPRECATED { if (ctx->md && ctx->md->cleanup) (ctx->md->cleanup)(ctx); + else if (ctx->md) + memset(ctx->ptr, 0, ctx->md->ctx_size); ctx->md = NULL; ctx->engine = NULL; free(ctx->ptr); -- 2.11.4.GIT