mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 16:56:01 +01:00
Fix a memory leak
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
05c44474d1
commit
013ac1f4b4
1 changed files with 2 additions and 1 deletions
|
@ -575,9 +575,10 @@ get_formatted_filename(zathura_t* zathura, const char* file_path, bool statusbar
|
||||||
&& file_path_len >= home_len
|
&& file_path_len >= home_len
|
||||||
&& g_str_has_prefix(file_path, home)
|
&& g_str_has_prefix(file_path, home)
|
||||||
&& (!file_path[home_len] || file_path[home_len] == '/')) {
|
&& (!file_path[home_len] || file_path[home_len] == '/')) {
|
||||||
|
g_free(home);
|
||||||
return g_strdup_printf("~%s", &file_path[home_len]);
|
return g_strdup_printf("~%s", &file_path[home_len]);
|
||||||
} else {
|
} else {
|
||||||
|
g_free(home);
|
||||||
return g_strdup(file_path);
|
return g_strdup(file_path);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue