summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-04-26 15:51:16 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-30 13:43:20 +0300
commitf795e365ecca6781cc99bd634f7a7e05bef1de95 (patch)
tree8ff28c9f7eb98dbde40496e1c137abf6e84b0b24
parentad3d715a8da076ab52f12b161961db9fdad13b93 (diff)
downloadconnman-f795e365ecca6781cc99bd634f7a7e05bef1de95.tar.gz
connman-f795e365ecca6781cc99bd634f7a7e05bef1de95.tar.bz2
connman-f795e365ecca6781cc99bd634f7a7e05bef1de95.zip
dnsproxy: Do not unref g_io_channel if we know it is null
Currently tethering does not support IPv6 so its listener is not created and is null. This will cause following output connmand[18363]: src/dnsproxy.c:destroy_tcp_listener() index 31 (connmand:18363): GLib-CRITICAL **: g_io_channel_unref: assertion `channel != NULL' failed connmand[18363]: src/dnsproxy.c:destroy_udp_listener() index 31 (connmand:18363): GLib-CRITICAL **: g_io_channel_unref: assertion `channel != NULL' failed
-rw-r--r--src/dnsproxy.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index 4ad4eb66..9030a355 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -3345,8 +3345,10 @@ static void destroy_udp_listener(struct listener_data *ifdata)
if (ifdata->udp6_listener_watch > 0)
g_source_remove(ifdata->udp6_listener_watch);
- g_io_channel_unref(ifdata->udp4_listener_channel);
- g_io_channel_unref(ifdata->udp6_listener_channel);
+ if (ifdata->udp4_listener_channel != NULL)
+ g_io_channel_unref(ifdata->udp4_listener_channel);
+ if (ifdata->udp6_listener_channel != NULL)
+ g_io_channel_unref(ifdata->udp6_listener_channel);
}
static void destroy_tcp_listener(struct listener_data *ifdata)
@@ -3358,8 +3360,10 @@ static void destroy_tcp_listener(struct listener_data *ifdata)
if (ifdata->tcp6_listener_watch > 0)
g_source_remove(ifdata->tcp6_listener_watch);
- g_io_channel_unref(ifdata->tcp4_listener_channel);
- g_io_channel_unref(ifdata->tcp6_listener_channel);
+ if (ifdata->tcp4_listener_channel != NULL)
+ g_io_channel_unref(ifdata->tcp4_listener_channel);
+ if (ifdata->tcp6_listener_channel != NULL)
+ g_io_channel_unref(ifdata->tcp6_listener_channel);
}
static int create_listener(struct listener_data *ifdata)