diff options
author | Tomas Bzatek <[email protected]> | 2020-07-20 13:14:51 +0200 |
---|---|---|
committer | Luke from DC <[email protected]> | 2020-07-29 20:47:20 +0000 |
commit | 39705f6ecb0b33eaeb520d08e90e0b9764b52dd1 (patch) | |
tree | 6ab006b7d2f0fe092692385d9fae3eac1ff9f79f | |
parent | 7e4c42739d50b712945080652f5e185bd65d412e (diff) | |
download | mate-panel-39705f6ecb0b33eaeb520d08e90e0b9764b52dd1.tar.bz2 mate-panel-39705f6ecb0b33eaeb520d08e90e0b9764b52dd1.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.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mate-panel/panel-menu-items.c b/mate-panel/panel-menu-items.c index 4885f1e8..a196b0be 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, |