Skip to content
Permalink
Browse files

pluma-utils: Fix memory leak

'g_strconcat' needs to be freed
  • Loading branch information...
sc0w committed Dec 5, 2018
1 parent e8cbd69 commit f8a009b91901e5cde98e97efb8469cabd7c7c368
Showing with 6 additions and 1 deletion.
  1. +6 −1 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;
}

0 comments on commit f8a009b

Please sign in to comment.
You can’t perform that action at this time.