Fixed memory leak when closing a DirHandle with a root (thanks, jajiradai!).

Fixes #3.
This commit is contained in:
Ryan C. Gordon 2022-05-20 21:27:17 -04:00
parent 17b691b0ea
commit 497934818b
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 2 additions and 0 deletions

View File

@ -1093,6 +1093,8 @@ static int freeDirHandle(DirHandle *dh, FileHandle *openList)
BAIL_IF(i->dirHandle == dh, PHYSFS_ERR_FILES_STILL_OPEN, 0);
dh->funcs->closeArchive(dh->opaque);
if (dh->root) allocator.Free(dh->root);
allocator.Free(dh->dirName);
allocator.Free(dh->mountPoint);
allocator.Free(dh);