mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-21 00:16:04 -04:00
linux_usbfs: Avoid file descriptor leak in error case
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
This commit is contained in:
@@ -1320,7 +1320,11 @@ static int op_open(struct libusb_device_handle *handle)
|
||||
hpriv->caps |= USBFS_CAP_BULK_CONTINUATION;
|
||||
}
|
||||
|
||||
return usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT);
|
||||
r = usbi_add_pollfd(HANDLE_CTX(handle), hpriv->fd, POLLOUT);
|
||||
if (r < 0)
|
||||
close(hpriv->fd);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
static void op_close(struct libusb_device_handle *dev_handle)
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define LIBUSB_NANO 11008
|
||||
#define LIBUSB_NANO 11009
|
||||
|
||||
Reference in New Issue
Block a user