ddiakopoulos / libnyquist

:microphone: Cross platform C++11 library for decoding audio (mp3, wav, ogg, opus, flac, etc)
BSD 2-Clause "Simplified" License
534 stars 64 forks source link

Memory leak when decoding mp3 file fix uses incorrect method to free memory. #54

Closed phniix closed 2 years ago

phniix commented 2 years ago

The most excellent memory leak find in https://github.com/ddiakopoulos/libnyquist/pull/48 has used the incorrect function to free the memory.

Taking a look at minimp3, https://github.com/ddiakopoulos/libnyquist/blob/244afdd52e8fc5bc0396cbcd9437b2d74271509f/third_party/minimp3/minimp3_ex.h#L408 we observe that malloc() was used to allocate the memory. The function used to remove the memory should be free() and not delete.

ddiakopoulos commented 2 years ago

Thanks for the fix @phniix !

phniix commented 2 years ago

No dramas at all! :D