diff --git a/port/posix/posix_transport_tcp.c b/port/posix/posix_transport_tcp.c index 2b014954b..1b2247b64 100644 --- a/port/posix/posix_transport_tcp.c +++ b/port/posix/posix_transport_tcp.c @@ -454,7 +454,7 @@ int posixTransportTcp_GetConnectFd(posixTransportTcpClientContext *context, case PTT_STATE_CONNECT_WAIT: case PTT_STATE_CONNECTED: ret = WH_ERROR_OK; - if (*out_fd) { + if (out_fd) { *out_fd = context->connect_fd_p1 - 1; } break; diff --git a/test/wh_test_crypto.c b/test/wh_test_crypto.c index 35310c6ea..4ea731b56 100644 --- a/test/wh_test_crypto.c +++ b/test/wh_test_crypto.c @@ -3734,6 +3734,7 @@ int whTestCrypto_MlDsaVerifyOnlyDma(whClientContext* ctx, int devId, int whTest_CryptoClientConfig(whClientConfig* config) { int i; + int rngInited = 0; whClientContext client[1] = {0}; int ret = 0; /* wolfcrypt */ @@ -3775,6 +3776,9 @@ int whTest_CryptoClientConfig(whClientConfig* config) if (ret != 0) { WH_ERROR_PRINT("Failed to reinitialize RNG %d\n", ret); } + else { + rngInited = 1; + } } if (ret == 0) { @@ -3935,7 +3939,9 @@ int whTest_CryptoClientConfig(whClientConfig* config) #endif /* WOLFHSM_CFG_TEST_VERBOSE */ /* Clean up used resources */ - (void)wc_FreeRng(rng); + if (rngInited) { + (void)wc_FreeRng(rng); + } (void)wh_Client_CommClose(client); (void)wh_Client_Cleanup(client);