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 - Memory leak in SDL_mixer in native_midi_common.c in function MIDItoStream
Summary: Memory leak in SDL_mixer in native_midi_common.c in function MIDItoStream
Status: RESOLVED FIXED
Alias: None
Product: SDL_mixer
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.0
Hardware: x86 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-24 09:43 UTC by Amit Jain
Modified: 2017-10-13 05:57 UTC (History)
0 users

See Also:


Attachments
Patch fixes memory leak in SDL_mixer (596 bytes, patch)
2015-07-24 09:44 UTC, Amit Jain
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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