From 7eed28fbe02e770529e12fb42e09f16bb8a84395 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 18 Dec 2023 11:15:28 -0600 Subject: [PATCH] src/ssl.c: in AddSessionToClientCache(), remove benign frivolous assignment, and fix so that ret is assigned only if no error. --- src/ssl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 3d7c66d26..e99f702f5 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -14409,19 +14409,19 @@ ClientSession* AddSessionToClientCache(int side, int row, int idx, byte* serverI } if (error == 0) { WOLFSSL_MSG("Adding client cache entry"); + + ret = &ClientCache[clientRow].Clients[clientIdx]; + if (ClientCache[clientRow].totalCount < CLIENT_SESSIONS_PER_ROW) ClientCache[clientRow].totalCount++; ClientCache[clientRow].nextIdx++; ClientCache[clientRow].nextIdx %= CLIENT_SESSIONS_PER_ROW; } - ret = &ClientCache[clientRow].Clients[clientIdx]; - wc_UnLockMutex(&clisession_mutex); } else { WOLFSSL_MSG("Hash session or lock failed"); - error = -1; } } else {