diff options
author | Geert Hauwaerts <geert@hauwaerts.be> | 2015-10-02 09:39:10 -0700 |
---|---|---|
committer | Geert Hauwaerts <geert@hauwaerts.be> | 2015-10-02 09:39:10 -0700 |
commit | 9c5f6780b286a919bc625011e8571af206e26e86 (patch) | |
tree | c12c1a360c4992307054445f5ea8421e4d3ef126 /src/core | |
parent | bd696a096ee782c3662a0bd81e0939357fdfb447 (diff) | |
parent | b545bc96a9e1a875beb50d9202161864ca8164d8 (diff) | |
download | irssi-9c5f6780b286a919bc625011e8571af206e26e86.zip |
Merge pull request #316 from LemonBoy/fix_mem_leak
Fix a memory leak.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/core.c b/src/core/core.c index b9debbb5..879d346f 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -156,11 +156,17 @@ static void sig_init_finished(void) static char *fix_path(const char *str) { char *new_str = convert_home(str); + if (!g_path_is_absolute(new_str)) { char *tmp_str = new_str; - new_str = g_strdup_printf("%s/%s", g_get_current_dir(), tmp_str); + char *current_dir = g_get_current_dir(); + + new_str = g_build_path(G_DIR_SEPARATOR_S, current_dir, tmp_str); + + g_free(current_dir); g_free(tmp_str); } + return new_str; } |