Skip to content
Permalink
Browse files

Fixed bug 3018 - Loading MIDI music using FluidSynth leaks memory.

Philipp Wiesemann

There is a memory leak in fluidsynth.c and fluidsynth_loadsong_RW_internal(). The allocated temporary buffer is not deleted if fluid_player_add_mem() returns FLUID_OK.
  • Loading branch information
slouken committed Jun 17, 2015
1 parent 0d01421 commit 169f565312a438351a886066f7a497f99ca3f636
Showing with 1 addition and 0 deletions.
  1. +1 −0 fluidsynth.c
@@ -124,6 +124,7 @@ static int fluidsynth_loadsong_RW_internal(FluidSynthMidiSong *song, void *data)
if ((buffer = (char*) SDL_malloc(size))) {
if(SDL_RWread(src, buffer, size, 1) == 1) {
if (fluidsynth.fluid_player_add_mem(song->player, buffer, size) == FLUID_OK) {
SDL_free(buffer);
return 1;
} else {
Mix_SetError("FluidSynth failed to load in-memory song");

0 comments on commit 169f565

Please sign in to comment.