[Telepathy-commits] [telepathy-idle/master] Fix a small leak reported by valgrind

Jonathon Jongsma jonathon.jongsma at collabora.co.uk
Mon Feb 16 20:16:29 PST 2009


Valgrind report was:
==24778== 240 bytes in 2 blocks are definitely lost in loss record 22 of 33
==24778==    at 0x4C2291E: malloc (vg_replace_malloc.c:207)
==24778==    by 0x550C272: g_malloc (in /usr/lib/libglib-2.0.so.0.1800.4)
==24778==    by 0x5539314: g_io_channel_unix_new (in /usr/lib/libglib-2.0.so.0.1800.4)
==24778==    by 0x4100E5: ssl_do_connect (idle-ssl-server-connection.c:480)
==24778==    by 0x4101E6: ssl_dns_result_cb (idle-ssl-server-connection.c:504)
==24778==    by 0x41136D: _resolve_idle_func (idle-dns-resolver.c:154)
==24778==    by 0x5503AFA: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.1800.4)
==24778==    by 0x55072BC: (within /usr/lib/libglib-2.0.so.0.1800.4)
==24778==    by 0x55077EC: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.1800.4)
==24778==    by 0x5E0A9C5: tp_run_connection_manager (in /usr/lib/libtelepathy-glib.so.0.22.1)
==24778==    by 0x406504: main (idle.c:38)

This was observed while valgrind-ing the connect-ssl-fail.py test
---
 src/idle-ssl-server-connection.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/idle-ssl-server-connection.c b/src/idle-ssl-server-connection.c
index d21599a..eac2b9a 100644
--- a/src/idle-ssl-server-connection.c
+++ b/src/idle-ssl-server-connection.c
@@ -441,6 +441,7 @@ static gboolean ssl_connect_io_func(GIOChannel *src, GIOCondition cond, gpointer
 		data->watch_id = 0;
 
 		g_io_channel_shutdown(data->io_chan, FALSE, NULL);
+		g_io_channel_unref(data->io_chan);
 		data->io_chan = NULL;
 
 		close(data->fd);
-- 
1.5.6.5




More information about the telepathy-commits mailing list