From 9b307dc1441a823e0a2b2f0c1d86c5362f55f18e Mon Sep 17 00:00:00 2001 From: Ameya Chawla <88154798+ameyachawlaggsipu@users.noreply.github.com> Date: Mon, 18 Oct 2021 09:36:14 +0530 Subject: [PATCH] fix: fixing memory leak errors --- numerical_methods/fast_fourier_transform.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/numerical_methods/fast_fourier_transform.cpp b/numerical_methods/fast_fourier_transform.cpp index 473cdbd2d..198f68f19 100644 --- a/numerical_methods/fast_fourier_transform.cpp +++ b/numerical_methods/fast_fourier_transform.cpp @@ -61,7 +61,8 @@ std::complex* FastFourierTransform(std::complex*p,uint64_t n) y[i]=ye[i]+pow(om,i)*yo[i]; ///Updating the first n/2 elements y[i+n/2]=ye[i]-pow(om,i)*yo[i];///Updating the last n/2 elements } - + free(ye); + free(yo); return y;///Returns the list } @@ -112,6 +113,8 @@ static void test() { o2++; } + free(o1); + free(o2); }