]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_omac.c
Avoid memory leak
[openssl-gost/engine.git] / gost_omac.c
index 0cbd45d2dd02a7913ba2bf382889da048e6a7b23..b4a4ed2baa4dba44fa09bcdae3dd35a044610fae 100644 (file)
@@ -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);