parse_response() will eventually call sort_and_return_results() which in turn,
will call the result function. But the result function might cancel the gresolv.
At the point: all queries belonging to this gresolv are destroyed. Back to
parse_response(), it calls again destroy_query() on an already destroyed one.
Thus leading to a crash.

Reported by Daniel Wagner
---
 gweb/gresolv.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/gweb/gresolv.c b/gweb/gresolv.c
index 322299a..d42f024 100644
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -731,11 +731,10 @@ static void parse_response(struct resolv_nameserver 
*nameserver,
        }
 
        g_queue_remove(resolv->query_queue, query);
+       destroy_query(query);
 
        if (lookup->ipv4_query == NULL && lookup->ipv6_query == NULL)
                sort_and_return_results(lookup);
-
-       destroy_query(query);
 }
 
 static gboolean received_udp_data(GIOChannel *channel, GIOCondition cond,
-- 
1.8.1.1

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to