VFS: Fix file handle leak in 7z
Jeffrey Pfau jeffrey@endrift.com
Fri, 24 Jul 2015 19:57:05 -0700
1 files changed,
2 insertions(+),
0 deletions(-)
jump to
M
src/util/vfs/vfs-lzma.c
→
src/util/vfs/vfs-lzma.c
@@ -95,6 +95,7 @@
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 @@
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; }