From efb3f3ec06af66a8f9304d828dd32d23c3c571ee Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 30 Aug 2016 04:40:13 +0200 Subject: [PATCH] open_default_config_file - don't initialize global until the end --- configuration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configuration.c b/configuration.c index 5bb9cf8a7f..91156be3bd 100644 --- a/configuration.c +++ b/configuration.c @@ -1301,7 +1301,7 @@ static config_file_t *open_default_config_file(void) char conf_path[PATH_MAX_LENGTH] = {0}; char app_path[PATH_MAX_LENGTH] = {0}; config_file_t *conf = NULL; - global_t *global = global_get_ptr(); + global_t *global = NULL; #if defined(_WIN32) && !defined(_XBOX) fill_pathname_application_path(app_path, sizeof(app_path)); @@ -1464,6 +1464,8 @@ static config_file_t *open_default_config_file(void) if (!conf) return NULL; + global = global_get_ptr(); + if (global) strlcpy(global->path.config, conf_path, sizeof(global->path.config)); return conf;