VFS: Fix file handle leak in 7z

This commit is contained in:
Jeffrey Pfau 2015-07-24 19:57:05 -07:00
parent e9436e43db
commit 97b82ae6cd
1 changed files with 2 additions and 0 deletions

View File

@ -95,6 +95,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) {
File_Close(&vd->archiveStream.file);
free(vd);
return 0;
}
@ -115,6 +116,7 @@ struct VDir* VDirOpen7z(const char* path, int flags) {
bool _vf7zClose(struct VFile* vf) {
struct VFile7z* vf7z = (struct VFile7z*) vf;
IAlloc_Free(&vf7z->vd->allocImp, vf7z->outBuffer);
File_Close(&vf7z->vd->archiveStream.file);
return true;
}