From 32f9f41c3d0bdc5a2e03689b592073ba11495e2f Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Mon, 20 Jul 2020 13:14:51 +0200 Subject: panel-menu-items: Fix leaking string The PANEL_GLIB_STR_EMPTY() macro returns TRUE even when the memory was allocated yet the string was empty, so do explicit free() here. --- mate-panel/panel-menu-items.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mate-panel/panel-menu-items.c b/mate-panel/panel-menu-items.c index 046d3ee3..febe7afa 100644 --- a/mate-panel/panel-menu-items.c +++ b/mate-panel/panel-menu-items.c @@ -1070,8 +1070,10 @@ panel_place_menu_item_create_menu (PanelPlaceMenuItem *place_item) gsettings_name = g_settings_get_string (place_item->priv->caja_desktop_settings, CAJA_DESKTOP_COMPUTER_ICON_NAME_KEY); - if (PANEL_GLIB_STR_EMPTY (gsettings_name)) + if (PANEL_GLIB_STR_EMPTY (gsettings_name)) { + g_free (gsettings_name); gsettings_name = g_strdup (_("Computer")); + } panel_menu_items_append_place_item ( PANEL_ICON_COMPUTER, NULL, -- cgit v1.2.1