summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-12-01 13:14:30 +0100
committerlukefromdc <[email protected]>2018-12-01 19:20:54 +0000
commit056832f5b6f0f122eb4f9d79c4363ccc818b8f8a (patch)
treed879d7696ccfa78ea6dcd0a714e673bffedf322a /eel
parentb475e1591055fbed53fb230223cacb0c8c70ce57 (diff)
downloadcaja-056832f5b6f0f122eb4f9d79c4363ccc818b8f8a.tar.bz2
caja-056832f5b6f0f122eb4f9d79c4363ccc818b8f8a.tar.xz
eel-gtk-extensions: Fix memory leaks
'g_strconcat' needs to be freed
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-gtk-extensions.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index 02898b82..19a44085 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -448,6 +448,7 @@ GtkWidget *
eel_image_menu_item_new_from_icon (const gchar *icon_name,
const gchar *label_name)
{
+ gchar *concat;
GtkWidget *icon;
GSettings *icon_settings;
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
@@ -460,7 +461,8 @@ eel_image_menu_item_new_from_icon (const gchar *icon_name,
/*Load an empty icon to hold the space*/
icon = gtk_image_new ();
- GtkWidget *label_menu = gtk_label_new_with_mnemonic (g_strconcat (label_name, " ", NULL));
+ concat = g_strconcat (label_name, " ", NULL);
+ GtkWidget *label_menu = gtk_label_new_with_mnemonic (concat);
GtkWidget *menuitem = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER (box), icon);
@@ -471,6 +473,7 @@ eel_image_menu_item_new_from_icon (const gchar *icon_name,
gtk_widget_show_all (menuitem);
g_object_unref(icon_settings);
+ g_free (concat);
return menuitem;
}
@@ -479,6 +482,7 @@ GtkWidget *
eel_image_menu_item_new_from_pixbuf (GdkPixbuf *icon_pixbuf,
const gchar *label_name)
{
+ gchar *concat;
GtkWidget *icon;
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
@@ -487,7 +491,8 @@ eel_image_menu_item_new_from_pixbuf (GdkPixbuf *icon_pixbuf,
else
icon = gtk_image_new ();
- GtkWidget *label_menu = gtk_label_new (g_strconcat (label_name, " ", NULL));
+ concat = g_strconcat (label_name, " ", NULL);
+ GtkWidget *label_menu = gtk_label_new (concat);
GtkWidget *menuitem = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER (box), icon);
@@ -496,5 +501,7 @@ eel_image_menu_item_new_from_pixbuf (GdkPixbuf *icon_pixbuf,
gtk_container_add (GTK_CONTAINER (menuitem), box);
gtk_widget_show_all (menuitem);
+ g_free (concat);
+
return menuitem;
}