From 228544c31ee2cf20d96caa86d7b34ce1a69588ae Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 19 Mar 2024 02:44:45 +0700 Subject: [PATCH] CID 327280 use after free in test case --- tests/api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/api.c b/tests/api.c index c6bd6ef5e..a37b880fd 100644 --- a/tests/api.c +++ b/tests/api.c @@ -2304,7 +2304,9 @@ static int test_wolfSSL_CertManagerAPI(void) #endif ExpectIntEQ(wolfSSL_CertManager_up_ref(cm), 1); - wolfSSL_CertManagerFree(cm); + if (EXPECT_SUCCESS()) { + wolfSSL_CertManagerFree(cm); + } wolfSSL_CertManagerFree(cm); cm = NULL;