forked from shauninman/MinUI
-
Notifications
You must be signed in to change notification settings - Fork 63
Closed
Description
Issue
There seems to be a memory leak in resampling code in api.c around line 2763 with the comment:
// No need to free - using static buffers
but in fact currently there are no static buffers. That buffer exists only in the "resampling optimisation" branch, the PR #592 is not merged yet.
Details
The git blame shows it sneaked in as part of another PR merge #573 .
I noticed this while perusing the resampling optimisation branch and wanting to apply it locally to test. But I remembered the peculiar comment already existed in my local copy.
The resampled.frames buffer it's supposed to free is most definitely mallocd in resample_audio() function. The resampling-optimisation branch does however use static buffers.
Solution
Simply revert to freeing the buffer:
free(resampled.frames);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels