diff options
| author | Dana Jansens <danakj@orodu.net> | 2007-03-18 15:23:42 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2007-03-18 15:23:42 +0000 |
| commit | 7db7d62ceb5064cd204444669f718397707b11d9 (patch) | |
| tree | 5c4a59201232294c0735cd9417e955d10cfd09c0 /parser/parse.c | |
| parent | 0ed1b678d18b07cfb5def76e0e5f7f14bc12e95c (diff) | |
free unused path strings.
always pass in malloc'd memory, cuz it is going to be freed later.
Diffstat (limited to 'parser/parse.c')
| -rw-r--r-- | parser/parse.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/parser/parse.c b/parser/parse.c index b288d016..fb53f1c5 100644 --- a/parser/parse.c +++ b/parser/parse.c @@ -335,6 +335,8 @@ static GSList* slist_path_add(GSList *list, gpointer data, GSListFunc func) if (!g_slist_find_custom(list, data, (GCompareFunc) slist_path_cmp)) list = func(list, data); + else + g_free(data); return list; } @@ -389,7 +391,7 @@ void parse_paths_startup() (GSListFunc) g_slist_append); } xdg_config_dir_paths = slist_path_add(xdg_config_dir_paths, - xdg_config_home_path, + g_strdup(xdg_config_home_path), (GSListFunc) g_slist_prepend); path = g_getenv("XDG_DATA_DIRS"); @@ -411,7 +413,7 @@ void parse_paths_startup() (GSListFunc) g_slist_append); } xdg_data_dir_paths = slist_path_add(xdg_data_dir_paths, - xdg_data_home_path, + g_strdup(xdg_data_home_path), (GSListFunc) g_slist_prepend); } |
