all repos — mgba @ 97b82ae6cdd2202e41d3c91df07979048d46a79f

mGBA Game Boy Advance Emulator

VFS: Fix file handle leak in 7z
Jeffrey Pfau jeffrey@endrift.com
Fri, 24 Jul 2015 19:57:05 -0700
commit

97b82ae6cdd2202e41d3c91df07979048d46a79f

parent

e9436e43dbc19b8f0e7e3a2a7e7c3d73cd6fcf14

1 files changed, 2 insertions(+), 0 deletions(-)

jump to
M src/util/vfs/vfs-lzma.csrc/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; }