mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-11 04:33:48 +01:00
Fix GString related memory leaks
This patch fixes a couple of GString related memory leaks. There is one left in the cmd_set() function for the 's' type settings, but to fix it we need to rework settings architecture a bit. Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Sebastian Ramacher <s.ramacher@gmx.at>
This commit is contained in:
parent
7a1a4d6ddd
commit
2e7dac75de
@ -3133,11 +3133,13 @@ cmd_open_bookmark(int argc, char** argv)
|
||||
if(!strcmp(id->str, Zathura.Bookmarks.bookmarks[i].id))
|
||||
{
|
||||
set_page(Zathura.Bookmarks.bookmarks[i].page);
|
||||
g_string_free(id, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
notify(WARNING, "No matching bookmark found");
|
||||
g_string_free(id, TRUE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -3202,10 +3204,12 @@ cmd_delete_bookmark(int argc, char** argv)
|
||||
|
||||
Zathura.Bookmarks.number_of_bookmarks--;
|
||||
|
||||
g_string_free(id, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
g_string_free(id, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user