From 2e7dac75ded51a1114148555e135cad149ddaf6c Mon Sep 17 00:00:00 2001 From: Pavel Borzenkov Date: Wed, 6 Jul 2011 15:04:09 +0400 Subject: [PATCH] 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 Signed-off-by: Sebastian Ramacher --- zathura.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zathura.c b/zathura.c index 4f897c7..d8be249 100644 --- a/zathura.c +++ b/zathura.c @@ -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; }