dnsproxy: Release all the fields of the request after forward dns reply
authorPaulo Pizarro <paulo.pizarro@gmail.com>
Mon, 18 Jun 2012 02:22:39 +0000 (23:22 -0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Mon, 18 Jun 2012 10:32:48 +0000 (13:32 +0300)
src/dnsproxy.c

index 5adede5..9a4fa47 100644 (file)
@@ -1609,9 +1609,6 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol,
        if (hdr->rcode > 0 && req->numresp < req->numserv)
                return -EINVAL;
 
-       if (req->timeout > 0)
-               g_source_remove(req->timeout);
-
        request_list = g_slist_remove(request_list, req);
 
        if (protocol == IPPROTO_UDP) {
@@ -1624,8 +1621,7 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol,
                close(sk);
        }
 
-       g_free(req->resp);
-       g_free(req);
+       destroy_request_data(req);
 
        return err;
 }