fix: don't free the same memory twice

This commit is contained in:
2025-03-22 15:33:24 +01:00
parent f4681cfc60
commit af2983b941

View File

@@ -173,8 +173,7 @@ audiodata audio_wav_load(audiodevice const* dev, char const* fpath) {
// load and parse the audio to the correct format
SDL_LoadWAV(fpath, &spec, &audio.buf, &audio.len);
if (!!audio_cvt(dev, &spec, &audio.buf, &audio.len)) {
free(audio.buf);
if (audio_cvt(dev, &spec, &audio.buf, &audio.len)) {
return (audiodata){0};
}