From 29b3f36fa4cfa31205ade8a3b8a28b89bcd37836 Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 8 Nov 2021 17:43:30 +0100 Subject: caja-sidebar-title: fix memory leak --- src/caja-sidebar-title.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c index bcba35cc..24dbbeaa 100644 --- a/src/caja-sidebar-title.c +++ b/src/caja-sidebar-title.c @@ -440,6 +440,7 @@ override_title_font (GtkWidget *widget, css = g_strdup_printf ("label { font-family: %s; font-size: %spt; }", tempfont, tempsize); gtk_css_provider_load_from_data (provider, css, -1, NULL); + g_free (tempsize); g_free (css); gtk_style_context_add_provider (gtk_widget_get_style_context (widget), @@ -458,6 +459,7 @@ update_title_font (CajaSidebarTitle *sidebar_title) GtkAllocation allocation; PangoFontDescription *title_font, *tmp_font; PangoLayout *layout; + char *title_font_str; /* Make sure theres work to do */ if (sidebar_title->details->title_text == NULL @@ -507,7 +509,9 @@ update_title_font (CajaSidebarTitle *sidebar_title) pango_font_description_set_size (title_font, max_fit_font_size * PANGO_SCALE); pango_font_description_set_weight (title_font, PANGO_WEIGHT_BOLD); - override_title_font (sidebar_title->details->title_label, pango_font_description_to_string (title_font)); + title_font_str = pango_font_description_to_string (title_font); + override_title_font (sidebar_title->details->title_label, title_font_str); + g_free (title_font_str); pango_font_description_free (title_font); } -- cgit v1.2.1