VFS: Fix memory leak when failing to open 7z

This commit is contained in:
Vicki Pfau 2018-09-03 11:29:02 -07:00
parent 880a86df30
commit ae40277f9d
1 changed files with 1 additions and 0 deletions

View File

@ -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;