summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <[email protected]>2020-07-20 13:14:51 +0200
committerPablo Barciela <[email protected]>2020-08-03 13:46:34 +0200
commit32f9f41c3d0bdc5a2e03689b592073ba11495e2f (patch)
treee7bf0dd153c5b7eb82f9ccdd0f919ee5de9dd609
parent1d48043b7b8fa0dfbe865ae94eff047f654f4931 (diff)
downloadmate-panel-32f9f41c3d0bdc5a2e03689b592073ba11495e2f.tar.bz2
mate-panel-32f9f41c3d0bdc5a2e03689b592073ba11495e2f.tar.xz
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.
-rw-r--r--mate-panel/panel-menu-items.c4
1 files changed, 3 insertions, 1 deletions
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,