diff -r 3a4c352a9a00 mixer.c --- a/mixer.c Thu Jul 14 12:33:48 2011 -0700 +++ b/mixer.c Sun Aug 07 01:42:09 2011 -0500 @@ -651,6 +651,7 @@ chunk->abuf = wavecvt.buf; chunk->alen = wavecvt.len_cvt; chunk->volume = MIX_MAX_VOLUME; + free(wavecvt.buf); return(chunk); } @@ -1287,8 +1288,6 @@ static int _Mix_register_effect(effect_info **e, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg) { - effect_info *new_e = malloc(sizeof (effect_info)); - if (!e) { Mix_SetError("Internal error"); return(0); @@ -1299,6 +1298,8 @@ return(0); } + effect_info *new_e = malloc(sizeof (effect_info)); + if (new_e == NULL) { Mix_SetError("Out of memory"); return(0); diff -r 3a4c352a9a00 timidity/readmidi.c --- a/timidity/readmidi.c Thu Jul 14 12:33:48 2011 -0700 +++ b/timidity/readmidi.c Sun Aug 07 01:42:09 2011 -0500 @@ -111,9 +111,9 @@ if (id==0x7f && len==7 && port==0x7f && model==0x04 && adhi==0x01) { ctl->cmsg(CMSG_TEXT, VERB_DEBUG, "Master Volume %d", s[4]+(s[5]<<7)); - free(s); *sysa = s[4]; *sysb = s[5]; + free(s); return ME_MASTERVOLUME; /** return s[4]+(s[5]<<7); **/ }