From 1441cb89b89c876728f1bd5aeea43e1df2fa709e Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Wed, 8 Apr 2026 12:34:41 +0100 Subject: [PATCH] Fix leak in linked-list F-2070 --- src/wolfsftp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wolfsftp.c b/src/wolfsftp.c index 01280df2..b4a946f8 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -4458,8 +4458,8 @@ int SFTP_RemoveHandleNode(WOLFSSH* ssh, byte* handle, word32 handleSz) cur->prev->next = cur->next; } - if (cur->next == NULL && cur->prev == NULL) { - ssh->handleList = NULL; + if (cur == ssh->handleList) { + ssh->handleList = cur->next; } WFREE(cur, ssh->ctx->heap, DYNTYPE_SFTP);