Don't infer last element of SSL session cache twice

Signed-off-by: Hanno Becker <hanno.becker@arm.com>
This commit is contained in:
Hanno Becker 2021-05-14 14:54:24 +01:00
parent 466ed6fd08
commit c3f4a97b8f

View file

@ -151,14 +151,11 @@ static int ssl_cache_pick_writing_slot( mbedtls_ssl_cache_context *cache,
while( cur != NULL )
{
count++;
if( session_id_len == cur->session_id_len &&
memcmp( session_id, cur->session_id, cur->session_id_len ) == 0 )
{
goto found;
}
last = cur;
cur = cur->next;
}