소스 검색

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

Fixes #3.
Ryan C. Gordon 3 년 전
부모
커밋
497934818b
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      src/physfs.c

+ 2 - 0
src/physfs.c

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