mirror of https://github.com/mgba-emu/mgba.git
VFS: Fix memory leak when failing to open 7z
This commit is contained in:
parent
880a86df30
commit
ae40277f9d
|
@ -98,6 +98,7 @@ struct VDir* VDirOpen7z(const char* path, int flags) {
|
|||
SzArEx_Init(&vd->db);
|
||||
SRes res = SzArEx_Open(&vd->db, &vd->lookStream.s, &vd->allocImp, &vd->allocTempImp);
|
||||
if (res != SZ_OK) {
|
||||
SzArEx_Free(&vd->db, &vd->allocImp);
|
||||
File_Close(&vd->archiveStream.file);
|
||||
free(vd);
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue