aboutsummaryrefslogtreecommitdiff
path: root/gost_omac.c
diff options
context:
space:
mode:
authorDmitry Belyavskiy <beldmit@gmail.com>2018-12-25 18:18:59 +0300
committerDmitry Belyavskiy <beldmit@gmail.com>2018-12-25 18:18:59 +0300
commit5639e179f1e378cd96336e639fa1eaceffc37521 (patch)
tree21cda0d67d098c3f0753fe858504df4213656c6a /gost_omac.c
parent3ae260799030954cd98730e4ff613af6b4ef6ae0 (diff)
downloadgost-engine-5639e179f1e378cd96336e639fa1eaceffc37521.zip
gost-engine-5639e179f1e378cd96336e639fa1eaceffc37521.tar.gz
gost-engine-5639e179f1e378cd96336e639fa1eaceffc37521.tar.bz2
Avoid memory leak
Diffstat (limited to 'gost_omac.c')
-rw-r--r--gost_omac.c1
1 files changed, 1 insertions, 0 deletions
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);