Fix leak in linked-list

F-2070
pull/908/head
Andrew Hutchings 2026-04-08 12:34:41 +01:00
parent 2abd046148
commit 1441cb89b8
1 changed files with 2 additions and 2 deletions

View File

@ -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);