summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorLeena Gunda <leena.gunda@wipro.com>2010-12-31 16:50:52 +0530
committerMarcel Holtmann <marcel@holtmann.org>2010-12-31 10:13:28 -0800
commit28cf4657843208384e592f09310043a5d42d36f0 (patch)
tree32a6d30047cf723e445900edbadb8a59be5184cd /plugins
parent37f7fdf4cd5ac0b6c31610bfd1dc652aa500e059 (diff)
downloadconnman-28cf4657843208384e592f09310043a5d42d36f0.tar.gz
connman-28cf4657843208384e592f09310043a5d42d36f0.tar.bz2
connman-28cf4657843208384e592f09310043a5d42d36f0.zip
Free the IO channel if connection to the DNS server fails
Fixes BMC#11878
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dnsproxy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/dnsproxy.c b/plugins/dnsproxy.c
index 5ce6429a..60b7a394 100644
--- a/plugins/dnsproxy.c
+++ b/plugins/dnsproxy.c
@@ -769,11 +769,14 @@ static struct server_data *create_server(const char *interface,
GList *list;
connman_error("Failed to connect to server %s", server);
- close(sk);
if (data->watch > 0)
g_source_remove(data->watch);
if (data->timeout > 0)
g_source_remove(data->timeout);
+
+ g_io_channel_unref(data->channel);
+ close(sk);
+
g_free(data->server);
g_free(data->interface);
for (list = data->domains; list; list = list->next) {