diff options
Diffstat (limited to 'core/macos.c')
-rw-r--r-- | core/macos.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/core/macos.c b/core/macos.c index b16225c78..37bbd5d25 100644 --- a/core/macos.c +++ b/core/macos.c @@ -81,18 +81,17 @@ const char *system_default_directory(void) const char *system_default_filename(void) { - static char *filename = NULL; - if (!filename) { + static const char *path = NULL; + if (!path) { const char *user = getenv("LOGNAME"); if (same_string(user, "")) user = "username"; - filename = calloc(strlen(user) + 5, 1); + char *filename = calloc(strlen(user) + 5, 1); strcat(filename, user); strcat(filename, ".xml"); - } - static const char *path = NULL; - if (!path) path = system_default_path_append(filename); + free(filename); + } return path; } |