This loop was always exited in the first iteration by `return`.
---
src/ssl_sock.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 01a5b3c4c..7ea8e26a3 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -6362,17 +6362,14 @@ struct tls_keys_ref *tlskeys_list_get_next(struct
tls_keys_ref *getnext, struct
{
struct tls_keys_ref *ref = getnext;
- while (1) {
+ /* Get next list entry. */
+ ref = LIST_NEXT(&ref->list, struct tls_keys_ref *, list);
- /* Get next list entry. */
- ref = LIST_NEXT(&ref->list, struct tls_keys_ref *, list);
-
- /* If the entry is the last of the list, return NULL. */
- if (&ref->list == end)
- return NULL;
+ /* If the entry is the last of the list, return NULL. */
+ if (&ref->list == end)
+ return NULL;
- return ref;
- }
+ return ref;
}
static inline
--
2.29.0