Fixed use after free bug.

This commit is contained in:
Mictronics 2017-02-22 15:39:09 +01:00
parent effca83150
commit 630136a1eb

View file

@ -224,9 +224,9 @@ bool rtlsdrOpen(void) {
closest = i;
}
rtlsdr_set_tuner_gain(RTLSDR.dev, gains[closest]);
free(gains);
rtlsdr_set_tuner_gain(RTLSDR.dev, gains[closest]);
fprintf(stderr, "rtlsdr: tuner gain set to %.1f dB\n",
rtlsdr_get_tuner_gain(RTLSDR.dev)/10.0);
}