music_modplug.c
changeset 561 87bdb4c81c0b
parent 542 3de4970b36d4
child 617 87116a42526e
     1.1 --- a/music_modplug.c	Fri Jan 13 02:39:41 2012 -0500
     1.2 +++ b/music_modplug.c	Fri Jan 13 03:15:19 2012 -0500
     1.3 @@ -85,19 +85,19 @@
     1.4  	SDL_RWseek(rw, 0, RW_SEEK_END);
     1.5  	sz = SDL_RWtell(rw)-offset;
     1.6  	SDL_RWseek(rw, offset, RW_SEEK_SET);
     1.7 -	buf=(char*)malloc(sz);
     1.8 +	buf=(char*)SDL_malloc(sz);
     1.9  	if(buf)
    1.10  	{
    1.11  		if(SDL_RWread(rw, buf, sz, 1)==1)
    1.12  		{
    1.13 -			music=(modplug_data*)malloc(sizeof(modplug_data));
    1.14 +			music=(modplug_data*)SDL_malloc(sizeof(modplug_data));
    1.15  			if (music)
    1.16  			{
    1.17  				music->playing=0;
    1.18  				music->file=ModPlug_Load(buf,sz);
    1.19  				if(!music->file)
    1.20  				{
    1.21 -					free(music);
    1.22 +					SDL_free(music);
    1.23  					music=NULL;
    1.24  				}
    1.25  			}
    1.26 @@ -106,7 +106,7 @@
    1.27  				SDL_OutOfMemory();
    1.28  			}
    1.29  		}
    1.30 -		free(buf);
    1.31 +		SDL_free(buf);
    1.32  	}
    1.33  	else
    1.34  	{
    1.35 @@ -227,7 +227,7 @@
    1.36  void modplug_delete(modplug_data *music)
    1.37  {
    1.38  	ModPlug_Unload(music->file);
    1.39 -	free(music);
    1.40 +	SDL_free(music);
    1.41  }
    1.42  
    1.43  /* Jump (seek) to a given position (time is in seconds) */