Skip to content

Commit

Permalink
Do not libusb_close on async failure to prevent segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Nov 22, 2016
1 parent 54b3014 commit 861294c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libmirisdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,13 @@ int mirisdr_close (mirisdr_dev_t *p) {
#endif

/* deinicializace tuneru */
if (p->dh) {
if (p->dh)
{
libusb_release_interface(p->dh, 0);
libusb_close(p->dh);

if (p->async_status != MIRISDR_ASYNC_FAILED) {
libusb_close(p->dh);
}
}

if (p->ctx) libusb_exit(p->ctx);
Expand Down

0 comments on commit 861294c

Please sign in to comment.