Skip to content

Commit 37206af

Browse files
committed
Fix memory leak
1 parent fac940c commit 37206af

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

platforms/shared/desktop/config.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void config_init(void)
109109
const char* root_path = NULL;
110110

111111
if (check_portable())
112-
root_path = SDL_GetBasePath();
112+
root_path = SDL_strdup(SDL_GetBasePath());
113113
else
114114
root_path = SDL_GetPrefPath("Geardome", GLYNX_TITLE);
115115

@@ -517,7 +517,6 @@ static bool check_portable(void)
517517
return false;
518518

519519
snprintf(portable_file_path, sizeof(portable_file_path), "%sportable.ini", base_path);
520-
SDL_free((void*)base_path);
521520

522521
FILE* file = fopen_utf8(portable_file_path, "r");
523522

0 commit comments

Comments
 (0)