Fix a memory leak

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2015-10-07 20:18:33 +02:00
parent 05c44474d1
commit 013ac1f4b4

View file

@ -575,9 +575,10 @@ get_formatted_filename(zathura_t* zathura, const char* file_path, bool statusbar
&& file_path_len >= home_len
&& g_str_has_prefix(file_path, home)
&& (!file_path[home_len] || file_path[home_len] == '/')) {
g_free(home);
return g_strdup_printf("~%s", &file_path[home_len]);
} else {
g_free(home);
return g_strdup(file_path);
}
} else {