diff options
author | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2016-04-29 18:07:38 +0100 |
---|---|---|
committer | Daniel Lockyer <thisisdaniellockyer@gmail.com> | 2016-04-29 18:07:38 +0100 |
commit | cdf017ceea0d09a6d5745c18cc0c8ae6232b49fa (patch) | |
tree | 029d63b6bfdc294a93f23098ac8e6151577aa346 | |
parent | c225bcaceeda6902a56481962398f5a528bcdf74 (diff) |
sway/config.c: wordexp has a corresponding wordfree which was never used
I had to change the assignment to path to be wrapped by strdup as we
pass the data out of the method.
-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) { int i; for (i = 0; i < (int)(sizeof(config_paths) / sizeof(char *)); ++i) { if (wordexp(config_paths[i], &p, 0) == 0) { - path = p.we_wordv[0]; + path = strdup(p.we_wordv[0]); if (file_exists(path)) { + wordfree(&p); return path; } } |