Skip to content

Commit 46c47e4

Browse files
committed
Fix a quick leak in the test apps
Fix a double-free scenario also
1 parent a3f3c76 commit 46c47e4

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tests/api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54597,9 +54597,8 @@ static int test_wolfSSL_DH(void)
5459754597
AssertNotNull(dh = DH_generate_parameters(2048, 2, NULL, NULL));
5459854598
AssertIntEQ(wolfSSL_DH_generate_parameters_ex(NULL, 2048, 2, NULL), 0);
5459954599
#endif
54600-
DH_free(dh);
54601-
#endif
54602-
#endif
54600+
#endif /* !HAVE_FIPS || (HAVE_FIPS_VERSION && HAVE_FIPS_VERSION > 2) */
54601+
#endif /* OPENSSL_ALL */
5460354602

5460454603
(void)dh;
5460554604
(void)p;
@@ -54775,10 +54774,12 @@ static int test_wolfSSL_DH_dup(void)
5477554774
dhDup = wolfSSL_DH_dup(dh);
5477654775
AssertNotNull(dhDup);
5477754776
wolfSSL_DH_free(dhDup);
54777+
#else
54778+
wolfSSL_BN_free(p);
54779+
wolfSSL_BN_free(g);
5477854780
#endif
5477954781

5478054782
wolfSSL_DH_free(dh);
54781-
5478254783
res = TEST_RES_CHECK(1);
5478354784
#endif
5478454785
#endif

0 commit comments

Comments
 (0)