X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Flibgame%2Fsound.c;h=a70ea3accf9018ed7c264f76b6bc06f61a89f5b6;hp=ea4e8463501efadeca90f46fc3670288a9bf411f;hb=8f33ee4940b9c35bf4627b7ef1126d03748da646;hpb=aca666256c715771b11d3277e10ff971aea44af8 diff --git a/src/libgame/sound.c b/src/libgame/sound.c index ea4e8463..a70ea3ac 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -569,8 +569,7 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl) &setup.override_level_sounds : &setup.override_level_music); - if (set_identifier) - free(set_identifier); + checked_free(set_identifier); set_identifier = checked_malloc(snd_ctrl->data_len); @@ -579,16 +578,12 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl) if (ti == NULL) ti = *ti_ptr = checked_calloc(sizeof(TreeInfo)); - if (leveldir_current->fullpath != NULL) - free(leveldir_current->fullpath); - if (leveldir_current->sounds_path != NULL) - free(leveldir_current->sounds_path); - if (leveldir_current->music_path != NULL) - free(leveldir_current->music_path); - if (ti->basepath != NULL) - free(ti->basepath); - if (ti->fullpath != NULL) - free(ti->fullpath); + + checked_free(leveldir_current->fullpath); + checked_free(leveldir_current->sounds_path); + checked_free(leveldir_current->music_path); + checked_free(ti->basepath); + checked_free(ti->fullpath); if (read(audio.mixer_pipe[0], set_identifier, snd_ctrl->data_len) != snd_ctrl->data_len || @@ -2387,8 +2382,7 @@ void FreeSound(void *ptr) #endif } - if (sound->source_filename) - free(sound->source_filename); + checked_free(sound->source_filename); free(sound); }