http://hg.libsdl.org/SDL_mixer/rev/56cad6484b04 https://bugs.gentoo.org/445980 # HG changeset patch # User Sam Lantinga # Date 1342998807 25200 # Node ID 56cad6484b04f83c8d42428c755a046678506436 # Parent c92001a2c18f628698c58aa4e05a7335d10d0e9e Paul P Komkoff Jr fixed malloc/free mismatch in the MikMod driver --- a/dynamic_mod.c +++ b/dynamic_mod.c @@ -93,6 +93,13 @@ SDL_UnloadObject(mikmod.handle); return -1; } + mikmod.MikMod_free = + (void (*)(void*)) + SDL_LoadFunction(mikmod.handle, "MikMod_free"); + if ( mikmod.MikMod_free == NULL ) { + SDL_UnloadObject(mikmod.handle); + return -1; + } mikmod.Player_Active = (BOOL (*)(void)) SDL_LoadFunction(mikmod.handle, "Player_Active"); --- a/dynamic_mod.h +++ b/dynamic_mod.h @@ -35,6 +35,7 @@ void (*MikMod_RegisterDriver)(struct MDRIVER*); int* MikMod_errno; char* (*MikMod_strerror)(int); + void (*MikMod_free)(void*); BOOL (*Player_Active)(void); void (*Player_Free)(MODULE*); MODULE* (*Player_LoadGeneric)(MREADER*,int,BOOL); --- a/music_mod.c +++ b/music_mod.c @@ -109,13 +109,13 @@ list = mikmod.MikMod_InfoDriver(); if ( list ) - free(list); + mikmod.MikMod_free(list); else mikmod.MikMod_RegisterDriver(mikmod.drv_nos); list = mikmod.MikMod_InfoLoader(); if ( list ) - free(list); + mikmod.MikMod_free(list); else mikmod.MikMod_RegisterAllLoaders();