From 8af742a93c68d26856e1882d4af5a4cc1249bd87 Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 28 Dec 2021 16:34:54 -0800 Subject: [PATCH] Fix to resolve possible memory leak with DSA `wc_DsaPublicKeyDecode` in API unit test when used with `HAVE_WOLF_BIGINT`. --- tests/api.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/api.c b/tests/api.c index 568e2564f..e77b9a4b4 100644 --- a/tests/api.c +++ b/tests/api.c @@ -20621,6 +20621,7 @@ static int test_wc_DsaKeyToPublicDer(void) } if (ret == 0) { word32 idx = 0; + wc_FreeDsaKey(&genKey); ret = wc_DsaPublicKeyDecode(der, &idx, &genKey, sz); } /* Test without the SubjectPublicKeyInfo header */ @@ -20635,6 +20636,7 @@ static int test_wc_DsaKeyToPublicDer(void) } if (ret == 0) { word32 idx = 0; + wc_FreeDsaKey(&genKey); ret = wc_DsaPublicKeyDecode(der, &idx, &genKey, sz); }