From 5639e179f1e378cd96336e639fa1eaceffc37521 Mon Sep 17 00:00:00 2001 From: Dmitry Belyavskiy Date: Tue, 25 Dec 2018 18:18:59 +0300 Subject: [PATCH] Avoid memory leak --- gost_omac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gost_omac.c b/gost_omac.c index 0cbd45d..b4a4ed2 100644 --- a/gost_omac.c +++ b/gost_omac.c @@ -132,6 +132,7 @@ static int omac_key(OMAC_CTX * c, const EVP_CIPHER *cipher, { int ret = 0; + CMAC_CTX_free(c->cmac_ctx);, c->cmac_ctx = CMAC_CTX_new(); if (c->cmac_ctx == NULL) { GOSTerr(GOST_F_OMAC_KEY, ERR_R_MALLOC_FAILURE); -- 2.39.2