[PATCH] dnsproxy: Shut down the GIO channel before freeing structure

patrik.flykt at linux.intel.com patrik.flykt at linux.intel.com
Fri Nov 16 04:25:41 PST 2012


From: Patrik Flykt <patrik.flykt at linux.intel.com>

The GIO channel needs to be shut down so that no pending input will
be received because the structure can be freed in the calling function.
---

	Hi,

This patch goes in after Forest Bond's dnsproxy patches. The GIO channel is
shut down in order not to receive any more data.

Cheers,

	Patrik


 src/dnsproxy.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index bfd0e3e..ba2dfaa 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -1765,6 +1765,7 @@ static void server_destroy_socket(struct server_data *data)
 		data->timeout = 0;
 	}
 
+	g_io_channel_shutdown(data->channel, TRUE, NULL);
 	g_io_channel_unref(data->channel);
 	data->channel = NULL;
 
-- 
1.7.10.4




More information about the connman mailing list