From 14a02d40024848aa6930e6efe3f26216675dd1fc Mon Sep 17 00:00:00 2001 From: marcoe Date: Tue, 4 Jul 2023 02:18:48 +0200 Subject: [PATCH 1/2] fix memory leak when selecting text --- zathura/page-widget.c | 1 - 1 file changed, 1 deletion(-) diff --git a/zathura/page-widget.c b/zathura/page-widget.c index d32c184..6991b91 100644 --- a/zathura/page-widget.c +++ b/zathura/page-widget.c @@ -1086,7 +1086,6 @@ cb_zathura_page_widget_motion_notify(GtkWidget* widget, GdkEventMotion* event) y2 = tmp.y1; } zathura_rectangle_t redraw_bounds = {0, y1, page_width, y2}; - priv->selection.list = zathura_page_get_selection(priv->page, scaled_mouse_selection, NULL); priv->selection.list = zathura_page_get_selection(priv->page, scaled_mouse_selection, NULL); if (priv->selection.list != NULL && girara_list_size(priv->selection.list) != 0) { From d9600b1cd7b71febd83b5ad94aecad532c892551 Mon Sep 17 00:00:00 2001 From: marcoe Date: Tue, 4 Jul 2023 02:20:20 +0200 Subject: [PATCH 2/2] fix mutex not being unlocked if malloc fails --- zathura/render.c | 1 + 1 file changed, 1 insertion(+) diff --git a/zathura/render.c b/zathura/render.c index b5a1041..ec2ef7a 100644 --- a/zathura/render.c +++ b/zathura/render.c @@ -449,6 +449,7 @@ zathura_render_request(ZathuraRenderRequest* request, gint64 last_view_time) render_job_t* job = g_try_malloc0(sizeof(render_job_t)); if (job == NULL) { + g_mutex_unlock(&request_priv->jobs_mutex); return; }