decoder/audiofile: allocate AFvirtualfile with malloc()

afCloseFile() uses free(), so we need to use malloc().
This commit is contained in:
Max Kellermann 2018-07-07 13:25:01 +02:00
parent 9b4156a282
commit 60821232b9

View File

@ -129,7 +129,7 @@ audiofile_file_seek(AFvirtualfile *vfile, AFfileoffset _offset,
static AFvirtualfile *
setup_virtual_fops(AudioFileInputStream &afis) noexcept
{
AFvirtualfile *vf = new AFvirtualfile();
AFvirtualfile *vf = (AFvirtualfile *)malloc(sizeof(*vf));
vf->closure = &afis;
vf->write = nullptr;
vf->read = audiofile_file_read;