summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-12-05 20:05:49 +0100
committerZenWalker <[email protected]>2018-12-06 15:56:53 +0100
commitf8a009b91901e5cde98e97efb8469cabd7c7c368 (patch)
tree3c27992d8ed683f7ff55a301b516bde4df3fe17b
parente8cbd69cc430cb184d20f34c8a26bac294fa946b (diff)
downloadpluma-f8a009b91901e5cde98e97efb8469cabd7c7c368.tar.bz2
pluma-f8a009b91901e5cde98e97efb8469cabd7c7c368.tar.xz
pluma-utils: Fix memory leak
'g_strconcat' needs to be freed
-rw-r--r--pluma/pluma-utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c
index c6e0a2e7..a7216955 100644
--- a/pluma/pluma-utils.c
+++ b/pluma/pluma-utils.c
@@ -1669,6 +1669,7 @@ GtkWidget *
pluma_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);
@@ -1677,7 +1678,9 @@ pluma_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);
@@ -1686,5 +1689,7 @@ pluma_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;
}