summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-08 17:43:30 +0100
committerraveit65 <[email protected]>2022-07-21 19:33:52 +0200
commite97cb1b0c0a7e402e31c722760cd45f50765986f (patch)
treeb6b746dd767c4daf16ab61db991dbaf6e8b4dd69
parentad3d7761d78d9b5ab0e0152194ebde58cf97a1f6 (diff)
downloadcaja-e97cb1b0c0a7e402e31c722760cd45f50765986f.tar.bz2
caja-e97cb1b0c0a7e402e31c722760cd45f50765986f.tar.xz
caja-sidebar-title: fix memory leak
-rw-r--r--src/caja-sidebar-title.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/caja-sidebar-title.c b/src/caja-sidebar-title.c
index 5fe42fc4..c45674d2 100644
--- a/src/caja-sidebar-title.c
+++ b/src/caja-sidebar-title.c
@@ -441,6 +441,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),
@@ -459,6 +460,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
@@ -508,7 +510,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);
}