From 62708d3d44102883d0a5fdb634fed4bf2b0574b5 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sun, 5 Feb 2012 21:17:59 +0100 Subject: [PATCH] fix some mem leaks in sc_follow --- shortcuts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shortcuts.c b/shortcuts.c index 64cc180..519a7b2 100644 --- a/shortcuts.c +++ b/shortcuts.c @@ -122,6 +122,7 @@ sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument), // TODO: is page visible? girara_list_t* links = zathura_page_links_get(page); if (links == NULL || girara_list_size(links) == 0) { + girara_list_free(links); continue; } @@ -138,6 +139,7 @@ sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument), cairo_move_to(cairo, position.x1 + 1, position.y1 - 1); char* link_number = g_strdup_printf("%i", ++link_id); cairo_show_text(cairo, link_number); + g_free(link_number); /* draw rectangle */ GdkColor color = zathura->ui.colors.highlight_color; @@ -146,8 +148,8 @@ sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument), cairo_fill(cairo); cairo_destroy(cairo); - GIRARA_LIST_FOREACH_END(links, zathura_link_t*, iter, link); + girara_list_free(links); } if (font != NULL) {