From 0119f31e89fea9a5d701a732685fe09f61500eb8 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 20 Jul 2020 17:36:45 +0200 Subject: workspace-switcher: Fix leaking color string --- applets/wncklet/workspace-switcher.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'applets/wncklet') diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c index 0e59dc00..4d74856b 100644 --- a/applets/wncklet/workspace-switcher.c +++ b/applets/wncklet/workspace-switcher.c @@ -256,16 +256,20 @@ static void applet_style_updated (MatePanelApplet *applet, GtkStyleContext *cont { GtkCssProvider *provider; GdkRGBA color; + gchar *color_str; + gchar *bg_css; provider = gtk_css_provider_new (); /* Provide a fallback color for the highlighted workspace based on the current theme */ gtk_style_context_lookup_color (context, "theme_selected_bg_color", &color); - gchar *bg_css = g_strconcat (".wnck-pager:selected {\n" - " background-color:", gdk_rgba_to_string (&color), ";\n" - "}", NULL); + color_str = gdk_rgba_to_string (&color); + bg_css = g_strconcat (".wnck-pager:selected {\n" + " background-color:", color_str, ";\n" + "}", NULL); gtk_css_provider_load_from_data (provider, bg_css, -1, NULL); g_free (bg_css); + g_free (color_str); gtk_style_context_add_provider (context, GTK_STYLE_PROVIDER (provider), -- cgit v1.2.1