From 3e5d70b7d9e1555e516547c7d6d56b712ea4ed15 Mon Sep 17 00:00:00 2001 From: hwspeedy Date: Thu, 14 Mar 2024 13:33:29 +0100 Subject: FIX FFT Benchmark memory leak --- modules/benchmark/fft.c | 2 +- modules/benchmark/fftbench.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/benchmark/fft.c b/modules/benchmark/fft.c index 503a7aaf..47acc369 100644 --- a/modules/benchmark/fft.c +++ b/modules/benchmark/fft.c @@ -21,7 +21,7 @@ #include "fftbench.h" /* if anything changes in this block, increment revision */ -#define BENCH_REVISION 2 +#define BENCH_REVISION 3 #define CRUNCH_TIME 5 static gpointer fft_for(void *in_data, gint thread_number) diff --git a/modules/benchmark/fftbench.c b/modules/benchmark/fftbench.c index 9449cffd..a531e276 100644 --- a/modules/benchmark/fftbench.c +++ b/modules/benchmark/fftbench.c @@ -69,7 +69,7 @@ static void lup_decompose(FFTBench *fftbench) double p, temp, **a; int *perm = (int *) malloc(sizeof(double) * N); - + free(fftbench->p); fftbench->p = perm; a = fftbench->a; @@ -181,6 +181,7 @@ FFTBench *fft_bench_new(void) } fftbench->b = (double *) malloc(sizeof(double) * N); + fftbench->p = NULL; for (i = 0; i < N; ++i) fftbench->b[i] = random_double(); -- cgit v1.2.3