summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-10-18 11:35:17 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-19 07:26:22 (GMT)
commitd620dbb4e5e30c86fc1f62c029dfe4b3d9e02bdf (patch)
tree41d417c9b70f91c70ebb36d1d8dc8fe198d27855
parent2807c98b033788032da2398cc35c516399b052b1 (diff)
downloadconnman-d620dbb4e5e30c86fc1f62c029dfe4b3d9e02bdf.zip
connman-d620dbb4e5e30c86fc1f62c029dfe4b3d9e02bdf.tar.gz
connman-d620dbb4e5e30c86fc1f62c029dfe4b3d9e02bdf.tar.bz2
gresolv: Make sure we will not receive DNS data after closing
We must close the channel when freeing the resolver object, otherwise we might still receive data when the resolver has been freed already. Fixes BMC#25757
-rw-r--r--gweb/gresolv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index da09b2b..cf7f2e9 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -554,8 +554,10 @@ static void free_nameserver(struct resolv_nameserver *nameserver)
if (nameserver->udp_watch > 0)
g_source_remove(nameserver->udp_watch);
- if (nameserver->udp_channel != NULL)
+ if (nameserver->udp_channel != NULL) {
+ g_io_channel_shutdown(nameserver->udp_channel, TRUE, NULL);
g_io_channel_unref(nameserver->udp_channel);
+ }
g_free(nameserver->address);
g_free(nameserver);