mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Free environment vars after loading config
Thanks @SyedAmerGilani
This commit is contained in:
parent
79f9d93ef3
commit
1ec8e082a2
1 changed files with 4 additions and 2 deletions
|
@ -71,8 +71,8 @@ static const char *search_paths[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *get_config_path() {
|
static char *get_config_path() {
|
||||||
char *home = getenv("HOME");
|
char *home = strdup(getenv("HOME"));
|
||||||
char *config = getenv("XDG_CONFIG_HOME");
|
char *config = strdup(getenv("XDG_CONFIG_HOME"));
|
||||||
if (!config) {
|
if (!config) {
|
||||||
const char *def = "/.config/sway";
|
const char *def = "/.config/sway";
|
||||||
config = malloc(strlen(home) + strlen(def) + 1);
|
config = malloc(strlen(home) + strlen(def) + 1);
|
||||||
|
@ -130,6 +130,8 @@ static char *get_config_path() {
|
||||||
|
|
||||||
_continue:
|
_continue:
|
||||||
free_config(temp_config);
|
free_config(temp_config);
|
||||||
|
free(home);
|
||||||
|
free(config);
|
||||||
return test;
|
return test;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue