linux_usbfs: Avoid file descriptor leak in error case
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
This commit is contained in:
parent
377f513da1
commit
3dbf0a9c5e
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue