From 697283ad0e6fce49d521dc528e9b3e239f6c2a28 Mon Sep 17 00:00:00 2001 From: Frank Leon Rose Date: Thu, 22 Apr 2021 13:59:46 -0400 Subject: [PATCH] Ensure get_server_path retval is freeable --- app/src/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/server.c b/app/src/server.c index cac7b367c5..4259edf138 100644 --- a/app/src/server.c +++ b/app/src/server.c @@ -61,7 +61,7 @@ get_server_path(void) { LOGE("Could not get executable path, " "using " SERVER_FILENAME " from current directory"); // not found, use current directory - return SERVER_FILENAME; + return SDL_strdup(SERVER_FILENAME); } char *dir = dirname(executable_path); size_t dirlen = strlen(dir); @@ -73,7 +73,7 @@ get_server_path(void) { LOGE("Could not alloc server path string, " "using " SERVER_FILENAME " from current directory"); SDL_free(executable_path); - return SERVER_FILENAME; + return SDL_strdup(SERVER_FILENAME); } memcpy(server_path, dir, dirlen);