From 4c4f8de0d54d894910472ea129284234550dc1ea Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 31 Mar 2021 02:42:15 -0400 Subject: [PATCH] Fix leaking GetBasePath result --- desktop_version/src/FileSystemUtils.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index ee14f3c5..bae70928 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -117,10 +117,12 @@ int FILESYSTEM_init(char *argvZero, char* baseDir, char *assetsPath) } else { + char *basePath = SDL_GetBasePath(); SDL_snprintf(output, sizeof(output), "%s%s", - SDL_GetBasePath(), + basePath, "data.zip" ); + SDL_free(basePath); } if (!PHYSFS_mount(output, NULL, 1)) {