Fixed use after free bug.
This commit is contained in:
parent
effca83150
commit
630136a1eb
|
@ -223,10 +223,10 @@ bool rtlsdrOpen(void) {
|
||||||
if (closest == -1 || abs(gains[i] - target) < abs(gains[closest] - target))
|
if (closest == -1 || abs(gains[i] - target) < abs(gains[closest] - target))
|
||||||
closest = i;
|
closest = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rtlsdr_set_tuner_gain(RTLSDR.dev, gains[closest]);
|
||||||
free(gains);
|
free(gains);
|
||||||
|
|
||||||
rtlsdr_set_tuner_gain(RTLSDR.dev, gains[closest]);
|
|
||||||
fprintf(stderr, "rtlsdr: tuner gain set to %.1f dB\n",
|
fprintf(stderr, "rtlsdr: tuner gain set to %.1f dB\n",
|
||||||
rtlsdr_get_tuner_gain(RTLSDR.dev)/10.0);
|
rtlsdr_get_tuner_gain(RTLSDR.dev)/10.0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue