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:
Pavel Borzenkov 2011-07-06 15:04:09 +04:00 committed by Sebastian Ramacher
parent 7a1a4d6ddd
commit 2e7dac75de

View File

@ -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;
}