mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
fix: fixing memory leak errors
This commit is contained in:
parent
5c23325ac5
commit
9b307dc144
@ -61,7 +61,8 @@ std::complex<double>* FastFourierTransform(std::complex<double>*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);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user