From 4a296f1bdeaa0e6e52a8b03fc6517b1aa162f8da Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 27 Sep 2024 18:19:30 -0400 Subject: [PATCH] filesystem: Fixed memory leak on Windows. --- src/filesystem/windows/SDL_sysfsops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/filesystem/windows/SDL_sysfsops.c b/src/filesystem/windows/SDL_sysfsops.c index da700d5247..b782b660d0 100644 --- a/src/filesystem/windows/SDL_sysfsops.c +++ b/src/filesystem/windows/SDL_sysfsops.c @@ -100,6 +100,7 @@ bool SDL_SYS_RemovePath(const char *path) WIN32_FILE_ATTRIBUTE_DATA info; if (!GetFileAttributesExW(wpath, GetFileExInfoStandard, &info)) { + SDL_free(wpath); if (GetLastError() == ERROR_FILE_NOT_FOUND) { // 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.