mixer.c
changeset 512 563dbb082a17
parent 506 586ae09f8176
child 514 247556e7809d
     1.1 --- a/mixer.c	Sun Aug 14 21:14:29 2011 -0400
     1.2 +++ b/mixer.c	Thu Aug 25 02:21:31 2011 -0400
     1.3 @@ -651,6 +651,7 @@
     1.4  	chunk->abuf = wavecvt.buf;
     1.5  	chunk->alen = wavecvt.len_cvt;
     1.6  	chunk->volume = MIX_MAX_VOLUME;
     1.7 +	free(wavecvt.buf);
     1.8  	return(chunk);
     1.9  }
    1.10  
    1.11 @@ -1287,7 +1288,7 @@
    1.12  static int _Mix_register_effect(effect_info **e, Mix_EffectFunc_t f,
    1.13  				Mix_EffectDone_t d, void *arg)
    1.14  {
    1.15 -	effect_info *new_e = malloc(sizeof (effect_info));
    1.16 +	effect_info *new_e;
    1.17  
    1.18  	if (!e) {
    1.19  		Mix_SetError("Internal error");
    1.20 @@ -1299,6 +1300,7 @@
    1.21  		return(0);
    1.22  	}
    1.23  
    1.24 +	new_e = malloc(sizeof (effect_info));
    1.25  	if (new_e == NULL) {
    1.26  		Mix_SetError("Out of memory");
    1.27  		return(0);