Skip to content

Memory leak in platform/fft-pffft.h #4

Description

@hgroenenboom

Hi,

First of thanks for the beautiful timestretch library! I've been using signalsmith-stretch with pffft and noticed a memory leak.

When Pow2FFT is destroyed it uses resize(0) to free up memory but it seems pffft (at least the pffft version I am using) always allocates memory even if size is 0:
https://github.com/marton78/pffft/blob/a4b03590cc2a4bea56f9721996e3057835799179/src/pffft_common.c#L10

I fixed this localy with

~Pow2RealFFT() {
	if (hasSetup) pffft_destroy_setup(fftSetup);
	if (work) pffft_aligned_free(work);
	if (tmpAligned) pffft_aligned_free(tmpAligned);
}

I think other.fftSetup = nullptr;is missing from the move constructor as well

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions