]> wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_omac.c
Merge pull request #137 from DJm00n/master
[openssl-gost/engine.git] / gost_omac.c
index 0cbd45d2dd02a7913ba2bf382889da048e6a7b23..91e9a48b5794ac0c1eb075de3dea21f8aaaf2b09 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);