summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaurav Babu <saurav.babu@samsung.com>2015-08-27 08:37:49 (GMT)
committerSaurav Babu <saurav.babu@samsung.com>2015-08-27 08:39:42 (GMT)
commit5ed0cd56b4136429745b26e58c65c0ca8892588c (patch)
tree4fb52dcea10a7384193df1c35da7f156b8c8064b
parentd7e2f52b32b60eeefa49dc7dfdad18595c8f7010 (diff)
downloadconnman-accepted/tizen/mobile/20150902.101338.zip
connman-accepted/tizen/mobile/20150902.101338.tar.gz
connman-accepted/tizen/mobile/20150902.101338.tar.bz2
Change-Id: Ie99a531c8d9573ab2db41ed3ea9e2ecd3cce5284 Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
-rwxr-xr-xsrc/dnsproxy.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index 948433d..f5ec502 100755
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2584,13 +2584,18 @@ static int server_create_socket(struct server_data *data)
static void destroy_server_sec(struct server_data *server)
{
GList *list;
+ int fd;
- DBG("index %d server %s sock %d", server->index, server->server,
- server->channel != NULL ?
- g_io_channel_unix_get_fd(server->channel): -1);
+ if(server->channel)
+ fd = g_io_channel_unix_get_fd(server->channel);
+ else
+ fd = -1;
+
+ DBG("index %d server %s sock %d", server->index, server->server, fd);
server_list_sec = g_slist_remove(server_list_sec, server);
- close(g_io_channel_unix_get_fd(server->channel));
+ if(fd > 0)
+ close(fd);
server_destroy_socket(server);
if (server->protocol == IPPROTO_UDP && server->enabled)