From 46c47e4adc5b3379cb2b53a20699d27b4f443a40 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Thu, 15 Dec 2022 08:23:33 -0700 Subject: [PATCH] Fix a quick leak in the test apps Fix a double-free scenario also --- tests/api.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/api.c b/tests/api.c index 43ced5e44..071041a17 100644 --- a/tests/api.c +++ b/tests/api.c @@ -54597,9 +54597,8 @@ static int test_wolfSSL_DH(void) AssertNotNull(dh = DH_generate_parameters(2048, 2, NULL, NULL)); AssertIntEQ(wolfSSL_DH_generate_parameters_ex(NULL, 2048, 2, NULL), 0); #endif - DH_free(dh); -#endif -#endif +#endif /* !HAVE_FIPS || (HAVE_FIPS_VERSION && HAVE_FIPS_VERSION > 2) */ +#endif /* OPENSSL_ALL */ (void)dh; (void)p; @@ -54775,10 +54774,12 @@ static int test_wolfSSL_DH_dup(void) dhDup = wolfSSL_DH_dup(dh); AssertNotNull(dhDup); wolfSSL_DH_free(dhDup); +#else + wolfSSL_BN_free(p); + wolfSSL_BN_free(g); #endif wolfSSL_DH_free(dh); - res = TEST_RES_CHECK(1); #endif #endif