diff options
-rw-r--r-- | sway/config.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c index 06654223..f60decb5 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -277,8 +277,9 @@ static char *get_config_path(void) { | |||
277 | int i; | 277 | int i; |
278 | for (i = 0; i < (int)(sizeof(config_paths) / sizeof(char *)); ++i) { | 278 | for (i = 0; i < (int)(sizeof(config_paths) / sizeof(char *)); ++i) { |
279 | if (wordexp(config_paths[i], &p, 0) == 0) { | 279 | if (wordexp(config_paths[i], &p, 0) == 0) { |
280 | path = p.we_wordv[0]; | 280 | path = strdup(p.we_wordv[0]); |
281 | if (file_exists(path)) { | 281 | if (file_exists(path)) { |
282 | wordfree(&p); | ||
282 | return path; | 283 | return path; |
283 | } | 284 | } |
284 | } | 285 | } |