From 9ee212cacc521fecd4fe955b1670df2cbaec2061 Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Mon, 23 Jun 2025 17:33:52 -0600 Subject: [PATCH] fix for free'ing memory with test case --- tests/api.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/api.c b/tests/api.c index 8cadb6af8..a311eb2b3 100644 --- a/tests/api.c +++ b/tests/api.c @@ -33211,7 +33211,7 @@ static int test_wolfSSL_RAND_bytes(void) max_bufsize = size4; - ExpectNotNull(my_buf = (byte*)XMALLOC(max_bufsize * sizeof(byte), NULL, + ExpectNotNull(my_buf = (byte*)XMALLOC(max_bufsize * sizeof(byte), HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER)); ExpectIntEQ(RAND_bytes(my_buf, 0), 1); @@ -33222,6 +33222,7 @@ static int test_wolfSSL_RAND_bytes(void) ExpectIntEQ(RAND_bytes(my_buf, size2), 1); ExpectIntEQ(RAND_bytes(my_buf, size3), 1); ExpectIntEQ(RAND_bytes(my_buf, size4), 1); + XFREE(my_buf, HEAP_HINT, DYNAMIC_TYPE_TMP_BUFFER); #if defined(OPENSSL_EXTRA) && defined(HAVE_GETPID) XMEMSET(seed, 0, sizeof(seed)); @@ -33262,8 +33263,6 @@ static int test_wolfSSL_RAND_bytes(void) } RAND_cleanup(); #endif - - XFREE(my_buf, NULL, DYNAMIC_TYPE_TMP_BUFFER); #endif return EXPECT_RESULT(); }