Skip to content

Commit 1441cb8

Browse files
committed
Fix leak in linked-list
F-2070
1 parent 2abd046 commit 1441cb8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/wolfsftp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4458,8 +4458,8 @@ int SFTP_RemoveHandleNode(WOLFSSH* ssh, byte* handle, word32 handleSz)
44584458
cur->prev->next = cur->next;
44594459
}
44604460

4461-
if (cur->next == NULL && cur->prev == NULL) {
4462-
ssh->handleList = NULL;
4461+
if (cur == ssh->handleList) {
4462+
ssh->handleList = cur->next;
44634463
}
44644464

44654465
WFREE(cur, ssh->ctx->heap, DYNTYPE_SFTP);

0 commit comments

Comments
 (0)