Merge pull request #534 from paulfd/audiofile-leaks

Free the audiofile structs on `st_close`
This commit is contained in:
JP Cimalando 2020-10-30 13:57:16 +01:00 committed by GitHub
commit 9aded8ce4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -155,7 +155,7 @@ void st_close(st_audio_file* af)
break;
}
af->type = st_audio_file_null;
free(af);
}
int st_get_type(st_audio_file* af)

View file

@ -52,10 +52,10 @@ st_audio_file* st_open_file_w(const wchar_t* filename)
void st_close(st_audio_file* af)
{
if (af->snd) {
if (af->snd)
sf_close(af->snd);
af->snd = NULL;
}
free(af);
}
int st_get_type(st_audio_file* af)