We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3072

Summary: Memory leak in SDL_mixer in native_midi_common.c in function MIDItoStream
Product: SDL_mixer Reporter: Amit Jain <amit.jain83>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.0   
Hardware: x86   
OS: Linux   
Attachments: Patch fixes memory leak in SDL_mixer

Description Amit Jain 2015-07-24 09:43:14 UTC
Memory leak in SDL_mixer-2.0.0 in native_midi_common.c in function MIDItoStream().

return without deletion of allocated memory.

static MIDIEvent *MIDItoStream(MIDIFile *mididata)
{
   ...
   ...
   ...
    track = (MIDIEvent**) calloc(1, sizeof(MIDIEvent*) * mididata->nTracks);

    if (NULL == track)
        return NULL;

 ...
 ...
 ...

}
Comment 1 Amit Jain 2015-07-24 09:44:28 UTC
Created attachment 2227 [details]
Patch fixes memory leak in SDL_mixer
Comment 2 Sam Lantinga 2017-10-13 05:57:35 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL_mixer/rev/2c0a45f9a767