Skip to content

Commit

Permalink
usb segfault correction
Browse files Browse the repository at this point in the history
libusb_release_interface() crashes when dev->devh is NULL
might be related to ihewitt#8
  • Loading branch information
jerome-labidurie committed Jun 24, 2015
1 parent 6f8139e commit 6c54880
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/poolmate.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,10 @@ int poolmate_cleanup()
c->img_transfer=0;
c->irq_transfer=0;

int errCode = libusb_release_interface(c->devh, 0);
int errCode = 0;
if (c->devh) {
errCode = libusb_release_interface(c->devh, 0);
}
if (errCode)
{
return -1;
Expand Down

0 comments on commit 6c54880

Please sign in to comment.