From 568fd67cab805bc6595c34f7a3cacc5f5e7e4d70 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Wed, 29 Jul 2015 09:49:27 +0200 Subject: account-widget: Fix 'default_display_name' leak do_constructed() leaks the string returned by tpaw_account_widget_get_default_display_name(): ==15713== 21 bytes in 1 blocks are definitely lost in loss record 3,415 of 16,664 ==15713== at 0x4A06C50: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==15713== by 0x36E2E76B57: vasprintf (vasprintf.c:76) ==15713== by 0x7F60DD2: g_vasprintf (gprintf.c:316) ==15713== by 0x7F30D70: g_strdup_vprintf (gstrfuncs.c:507) ==15713== by 0x7F30E15: g_strdup_printf (gstrfuncs.c:533) ==15713== by 0x4FAAD98: tpaw_account_widget_get_default_display_name (tpaw-account-widget.c:2192) ==15713== by 0x4FAA444: do_constructed (tpaw-account-widget.c:1960) ==15713== by 0x7C7CC10: g_object_new_internal (gobject.c:1814) ==15713== by 0x7C7D71A: g_object_new_valist (gobject.c:2033) ==15713== by 0x7C7C6C5: g_object_new (gobject.c:1617) ==15713== by 0x4FAABCC: tpaw_account_widget_new_for_protocol (tpaw-account-widget.c:2127) ==15713== by 0x4F81352: edit_connection_parameters (goatelepathyprovider.c:544) https://bugzilla.gnome.org/show_bug.cgi?id=752938 --- tp-account-widgets/tpaw-account-widget.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tp-account-widgets') diff --git a/tp-account-widgets/tpaw-account-widget.c b/tp-account-widgets/tpaw-account-widget.c index 93b672de..64a97d15 100644 --- a/tp-account-widgets/tpaw-account-widget.c +++ b/tp-account-widgets/tpaw-account-widget.c @@ -1787,7 +1787,8 @@ static void do_constructed (GObject *obj) { TpawAccountWidget *self = TPAW_ACCOUNT_WIDGET (obj); - const gchar *display_name, *default_display_name; + const gchar *display_name; + gchar *default_display_name; guint i = 0; struct { const gchar *cm_name; @@ -1967,6 +1968,7 @@ do_constructed (GObject *obj) g_object_set (self->priv->settings, "display-name-overridden", TRUE, NULL); } + g_free (default_display_name); } static void -- cgit v1.2.1