Skip to content

Commit 4283b1b

Browse files
committed
transfer: avoid a potential double free that gets asserted in rare cases
1 parent 96cbcd3 commit 4283b1b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

libusb/src/driver/transfer.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,9 @@ NTSTATUS transfer(libusb_device_t* dev,
164164
goto transfer_free;
165165
}
166166

167+
/* Do not check this status code, as the request might complete during call,
168+
so we do *not* want to free anything here as that would lead to double-free */
167169
status = transfer_next(dev, irp, context);
168-
if (!NT_SUCCESS(status))
169-
{
170-
goto transfer_free;
171-
}
172170

173171
InterlockedExchange(&dev->pending_busy[endpoint->address], 0);
174172
return status;

0 commit comments

Comments
 (0)