Skip to content
Permalink
Browse files

math-window: Fix memory leak

'g_strconcat' needs to be freed
  • Loading branch information...
sc0w authored and lukefromdc committed Dec 1, 2018
1 parent 3693bc6 commit ab8897e16fbf4a64c2c8b260a1c34e096551b46d
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/math-window.c
@@ -360,11 +360,14 @@ static GtkWidget *gtk_image_menu_item_new_from_icon (const gchar *icon_name,
const gchar *label_name,
GtkAccelGroup *accel_group)
{
gchar *concat = g_strconcat (label_name, " ", NULL);
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
GtkWidget *icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
GtkWidget *label = gtk_accel_label_new (g_strconcat (label_name, " ", NULL));
GtkWidget *label = gtk_accel_label_new (concat);
GtkWidget *menu_item = gtk_menu_item_new ();

g_free (concat);

gtk_container_add (GTK_CONTAINER (box), icon);

gtk_label_set_use_underline (GTK_LABEL (label), TRUE);

0 comments on commit ab8897e

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