Fix memory leaks in audiolib. Fixes issue #59.

git-svn-id: https://svn.eduke32.com/eduke32@6202 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2017-06-19 23:06:53 +00:00
parent da4081c2b6
commit e51960b3a2
3 changed files with 3 additions and 0 deletions

View file

@ -462,6 +462,7 @@ int32_t MV_PlayFLAC(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t lo
/*metadata_flac_stream*/ NULL, error_flac_stream,
(void *)fd) != FLAC__STREAM_DECODER_INIT_STATUS_OK)
{
free(fd);
MV_Printf("MV_PlayFLAC: %s\n", FLAC__stream_decoder_get_resolved_state_string(fd->stream));
MV_SetErrorCode(MV_InvalidFile);
return MV_Error;

View file

@ -398,6 +398,7 @@ int32_t MV_PlayVorbis(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t
if (status < 0)
{
free(vd);
MV_Printf("MV_PlayVorbis: err %d\n", status);
MV_SetErrorCode(MV_InvalidFile);
return MV_Error;

View file

@ -138,6 +138,7 @@ int32_t MV_PlayXMP(char *ptr, uint32_t ptrlength, int32_t loopstart, int32_t loo
if ((retval = xmp_load_module_from_memory(xmpd->context, ptr, ptrlength)) != 0)
{
free(xmpd);
MV_Printf("MV_PlayXMP: xmp_load_module_from_memory failed (%i)\n", retval);
MV_SetErrorCode(MV_InvalidFile);
return MV_Error;