[raudio]: free converterResidual in UnloadSoundAlias to prevent leak (#5857)

The example audio_sound_multi was leaking memory every single time the spacebar was pressed.

```c
Direct leak of 576 byte(s) in 9 object(s) allocated from:
    #0 0x758a41019447 in calloc (/usr/lib/liblsan.so.0+0x19447) (BuildId: 8ee115309adc591d231c961c43d245cfa68d9aa7)
    #1 0x562dfbd2c4f3 in LoadAudioBuffer (/home/peter/raylib/examples/audio/audio_sound_multi+0xfa4f3) (BuildId: ea2a6f45d724abeccf904143a32012266f259f93)
```

This patch fixes that leak.
This commit is contained in:
Peter0x44
2026-05-10 14:01:38 +01:00
committed by GitHub
parent 07b729d5d6
commit dcb0ca5d14

View File

@@ -1048,6 +1048,7 @@ void UnloadSoundAlias(Sound alias)
{
UntrackAudioBuffer(alias.stream.buffer);
ma_data_converter_uninit(&alias.stream.buffer->converter, NULL);
RL_FREE(alias.stream.buffer->converterResidual);
RL_FREE(alias.stream.buffer);
}
}