summaryrefslogtreecommitdiff
path: root/src/dnsproxy.c
diff options
context:
space:
mode:
authorJulien Massot <jmassot@aldebaran-robotics.com>2012-03-14 08:59:07 +0000
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-03-21 10:43:58 +0200
commit791e46222bd1d67bc21182a930a119a910a86c6f (patch)
tree47376b66ea569c0bec20700ac08f6e1615e92075 /src/dnsproxy.c
parent6e2e4e84e8fb996d5eaf53e0bfb4d0679c337bb4 (diff)
downloadconnman-791e46222bd1d67bc21182a930a119a910a86c6f.tar.gz
connman-791e46222bd1d67bc21182a930a119a910a86c6f.tar.bz2
connman-791e46222bd1d67bc21182a930a119a910a86c6f.zip
dnsproxy: Remove pending requests before destroying the channel
This fixes a segfault in request_timeout when disabling tethering.
Diffstat (limited to 'src/dnsproxy.c')
-rw-r--r--src/dnsproxy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index e0b8da21..7c75dd88 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2662,6 +2662,8 @@ static void destroy_listener(struct listener_data *ifdata)
DBG("Dropping pending request (id 0x%04x -> 0x%04x)",
req->srcid, req->dstid);
+ if (req->timeout > 0)
+ g_source_remove(req->timeout);
g_free(req->resp);
g_free(req->request);
@@ -2678,6 +2680,8 @@ static void destroy_listener(struct listener_data *ifdata)
DBG("Dropping request (id 0x%04x -> 0x%04x)",
req->srcid, req->dstid);
+ if (req->timeout > 0)
+ g_source_remove(req->timeout);
g_free(req->resp);
g_free(req->request);