summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2018-12-01 11:41:35 +0100
committerlukefromdc <[email protected]>2018-12-01 19:34:29 +0000
commitab8897e16fbf4a64c2c8b260a1c34e096551b46d (patch)
tree946c20ae26957d8dee05ee9fc32e37d30f0213e1 /src
parent3693bc66677c1d6a81363d4434d1bd0ecee307ed (diff)
downloadmate-calc-ab8897e16fbf4a64c2c8b260a1c34e096551b46d.tar.bz2
mate-calc-ab8897e16fbf4a64c2c8b260a1c34e096551b46d.tar.xz
math-window: Fix memory leak
'g_strconcat' needs to be freed
Diffstat (limited to 'src')
-rw-r--r--src/math-window.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/math-window.c b/src/math-window.c
index 854a746..c24b3fa 100644
--- a/src/math-window.c
+++ b/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);