mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-04 03:56:00 +01:00
fix some mem leaks in sc_follow
This commit is contained in:
parent
509c58b95e
commit
62708d3d44
1 changed files with 3 additions and 1 deletions
|
@ -122,6 +122,7 @@ sc_follow(girara_session_t* session, girara_argument_t* UNUSED(argument),
|
||||||
// TODO: is page visible?
|
// TODO: is page visible?
|
||||||
girara_list_t* links = zathura_page_links_get(page);
|
girara_list_t* links = zathura_page_links_get(page);
|
||||||
if (links == NULL || girara_list_size(links) == 0) {
|
if (links == NULL || girara_list_size(links) == 0) {
|
||||||
|
girara_list_free(links);
|
||||||
continue;
|
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);
|
cairo_move_to(cairo, position.x1 + 1, position.y1 - 1);
|
||||||
char* link_number = g_strdup_printf("%i", ++link_id);
|
char* link_number = g_strdup_printf("%i", ++link_id);
|
||||||
cairo_show_text(cairo, link_number);
|
cairo_show_text(cairo, link_number);
|
||||||
|
g_free(link_number);
|
||||||
|
|
||||||
/* draw rectangle */
|
/* draw rectangle */
|
||||||
GdkColor color = zathura->ui.colors.highlight_color;
|
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_fill(cairo);
|
||||||
|
|
||||||
cairo_destroy(cairo);
|
cairo_destroy(cairo);
|
||||||
|
|
||||||
GIRARA_LIST_FOREACH_END(links, zathura_link_t*, iter, link);
|
GIRARA_LIST_FOREACH_END(links, zathura_link_t*, iter, link);
|
||||||
|
girara_list_free(links);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (font != NULL) {
|
if (font != NULL) {
|
||||||
|
|
Loading…
Reference in a new issue