Skip to content

Commit

Permalink
A few cppcheck fixes.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #1269.

Thanks to Joshua Beck for the patch!
  • Loading branch information
icculus committed Aug 25, 2011
1 parent 240681a commit 77980c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion mixer.c
Expand Up @@ -651,6 +651,7 @@ Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc)
chunk->abuf = wavecvt.buf;
chunk->alen = wavecvt.len_cvt;
chunk->volume = MIX_MAX_VOLUME;
free(wavecvt.buf);
return(chunk);
}

Expand Down Expand Up @@ -1287,7 +1288,7 @@ int Mix_GroupNewer(int tag)
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));
effect_info *new_e;

if (!e) {
Mix_SetError("Internal error");
Expand All @@ -1299,6 +1300,7 @@ static int _Mix_register_effect(effect_info **e, Mix_EffectFunc_t f,
return(0);
}

new_e = malloc(sizeof (effect_info));
if (new_e == NULL) {
Mix_SetError("Out of memory");
return(0);
Expand Down
2 changes: 1 addition & 1 deletion timidity/readmidi.c
Expand Up @@ -111,9 +111,9 @@ static int sysex(uint32 len, uint8 *syschan, uint8 *sysa, uint8 *sysb, SDL_RWops
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); **/
}
Expand Down

0 comments on commit 77980c9

Please sign in to comment.