From: Daniel Boles Date: Thu, 7 Sep 2017 13:53:59 +0000 (+0100) Subject: Entry: Fix leak of text in ensure_has_tooltip() X-Git-Tag: archive/raspbian/3.24.39-1+rpi1~1^2~65^2~39^2~200 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=660cc709fc546f7118fda189779e3a04a291934d;p=gtk%2B3.0.git Entry: Fix leak of text in ensure_has_tooltip() Thanks to Mohammed Sadiq for noticing this. I guess I got Widget.get_tooltip_text() confused with Label.get_label(). https://bugzilla.gnome.org/show_bug.cgi?id=787410 --- diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 2ee69315bb..d97b6e97c3 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -9192,7 +9192,8 @@ gtk_entry_get_icon_area (GtkEntry *entry, static void ensure_has_tooltip (GtkEntry *entry) { - gboolean has_tooltip = gtk_widget_get_tooltip_text (GTK_WIDGET (entry)) != NULL; + gchar *text = gtk_widget_get_tooltip_text (GTK_WIDGET (entry)); + gboolean has_tooltip = text != NULL; if (!has_tooltip) { @@ -9210,6 +9211,10 @@ ensure_has_tooltip (GtkEntry *entry) } } } + else + { + g_free (text); + } gtk_widget_set_has_tooltip (GTK_WIDGET (entry), has_tooltip); }