1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-29 19:28:47 -05:00

Fixed possible memory leak in green FFT (g_fft)

This commit is contained in:
f4exb 2018-02-18 00:20:37 +01:00
parent 790e5d3bc8
commit ffbc08841e

View File

@ -3247,7 +3247,9 @@ void g_fft<FFT_TYPE>::fftInit()
FFT_table_2[FFT_N/2] = new short[POW2(FFT_N/2 - 1)];
fftBRInit(FFT_N, FFT_table_2[FFT_N/2]);
if ((FFT_N % 2) == 0) { // FFT_N/2 = (FFT_N-1)/2 if FFT_N is odd. Prevents memory leak
FFT_table_2[(FFT_N - 1) / 2] = new short[POW2((FFT_N - 1) / 2 - 1)];
}
fftBRInit(FFT_N - 1, FFT_table_2[(FFT_N - 1) / 2]);
Utbl = ((FFT_TYPE**) FFT_table_1)[FFT_N];