From 06d6e5df6e6631c81ae4d61414108435f0707688 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Wed, 25 Jul 2018 01:52:55 +0200 Subject: pluma-view: Fix possible memory leak --- pluma/pluma-view.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c index 28b39fe4..d488777e 100644 --- a/pluma/pluma-view.c +++ b/pluma/pluma-view.c @@ -675,7 +675,7 @@ contextmenu_font_changed_cb (GSettings *settings, sys_font_desc = get_system_font (); if (sys_font_desc) { - pluma_override_font (".context-menu", GTK_WIDGET (user_data), sys_font_desc); + pluma_override_font (".context-menu", NULL, sys_font_desc); pango_font_description_free (sys_font_desc); } } @@ -718,10 +718,13 @@ pluma_override_font (const gchar *item, { if (strstr (prov_str, ".context-menu")) { - prov_str = g_strdelimit (prov_str, "}", '\0'); - prov_str = g_strdup_printf ("%s}", prov_str); + g_strdelimit (prov_str, "}", '\0'); + gchar *prov_new_str = g_strdup_printf ("%s}", prov_str); + css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_new_str, item, family, weight, style, size); + g_free (prov_new_str); } - css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_str, item, family, weight, style, size); + else + css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_str, item, family, weight, style, size); } else css = g_strdup_printf ("%s { %s %s %s %s }", item, family, weight, style, size); -- cgit v1.2.1