浏览代码

filesystem: Fixed memory leak on Windows.

Ryan C. Gordon 1 年之前
父节点
当前提交
4a296f1bde
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/filesystem/windows/SDL_sysfsops.c

+ 1 - 0
src/filesystem/windows/SDL_sysfsops.c

@@ -100,6 +100,7 @@ bool SDL_SYS_RemovePath(const char *path)
 
 
     WIN32_FILE_ATTRIBUTE_DATA info;
     WIN32_FILE_ATTRIBUTE_DATA info;
     if (!GetFileAttributesExW(wpath, GetFileExInfoStandard, &info)) {
     if (!GetFileAttributesExW(wpath, GetFileExInfoStandard, &info)) {
+        SDL_free(wpath);
         if (GetLastError() == ERROR_FILE_NOT_FOUND) {
         if (GetLastError() == ERROR_FILE_NOT_FOUND) {
             // Note that ERROR_PATH_NOT_FOUND means a parent dir is missing, and we consider that an error.
             // Note that ERROR_PATH_NOT_FOUND means a parent dir is missing, and we consider that an error.
             return true;  // thing is already gone, call it a success.
             return true;  // thing is already gone, call it a success.