Skip to content
Permalink
Browse files

Paul P Komkoff Jr fixed malloc/free mismatch in the MikMod driver

  • Loading branch information
slouken committed Jul 22, 2012
1 parent 31dac27 commit cfe60fd7388a6f9eef86844d0daf1ee410e927c9
Showing with 14 additions and 2 deletions.
  1. +4 −0 CHANGES
  2. +7 −0 dynamic_mod.c
  3. +1 −0 dynamic_mod.h
  4. +2 −2 music_mod.c
@@ -1,3 +1,7 @@
1.2.13:
Paul P Komkoff Jr - Sun Jul 22 16:12:28 PDT 2012
* Fixed malloc/free mismatch in the MikMod driver

1.2.12:
Sam Lantinga - Sat Jan 14 22:00:29 2012 -0500
* Fixed seek offset with SMPEG (was relative, should be absolute)
@@ -93,6 +93,13 @@ int Mix_InitMOD()
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");
@@ -35,6 +35,7 @@ typedef struct {
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);
@@ -109,13 +109,13 @@ int MOD_init(SDL_AudioSpec *mixerfmt)

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();

0 comments on commit cfe60fd

Please sign in to comment.