Skip to content

Commit

Permalink
Merge pull request #73 from zuckschwerdt/fix-segf
Browse files Browse the repository at this point in the history
Fix rx_fm segfault if device can't be opened
  • Loading branch information
guruofquality committed Mar 1, 2019
2 parents 4199fc9 + 51a097a commit f562c5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rtl_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,12 +1388,12 @@ int main(int argc, char **argv)

tmp_stdout = suppress_stdout_start();
verbose_device_search(dongle.dev_query, &dongle.dev);
verbose_setup_stream(dongle.dev, &dongle.stream, dongle.channel, SOAPY_SDR_CS16);

if (!dongle.dev) {
fprintf(stderr, "Failed to open sdr device matching '%s'.\n", dongle.dev_query);
exit(1);
}
verbose_setup_stream(dongle.dev, &dongle.stream, dongle.channel, SOAPY_SDR_CS16);

#ifndef _WIN32
sigact.sa_handler = sighandler;
sigemptyset(&sigact.sa_mask);
Expand Down

0 comments on commit f562c5d

Please sign in to comment.