Skip to content

Commit 13e6f11

Browse files
authored
Fix a memory leak introduced by last commit for high level EVP API #82
The last commit to use Openssl high level EVP API for CMAC has an issue where the EVP_MAC object created by EVP_MAC_fetch() is not freed. Added the EVP_MAC_free() to free the fetched object after use.
2 parents 413704a + 225157a commit 13e6f11

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/crypto/crypto_openssl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,6 +1253,7 @@ int omac1_aes_vector(const u8 *key, size_t key_len, size_t num_elem,
12531253
ret = 0;
12541254
fail:
12551255
EVP_MAC_CTX_free(ctx);
1256+
EVP_MAC_free(emac);
12561257
return ret;
12571258
#else /* OpenSSL version >= 3.0 */
12581259
CMAC_CTX *ctx;

0 commit comments

Comments
 (0)