android: Fix memory leaks in DNS proxy
Fixes: 2dc26c557e ("android: Add DNS proxy implementation")
This commit is contained in:
@@ -175,6 +175,7 @@ CALLBACK(handle_response, bool,
|
|||||||
}
|
}
|
||||||
packet = ip_packet_create_udp_from_data(src, this->src,
|
packet = ip_packet_create_udp_from_data(src, this->src,
|
||||||
chunk_create(buf, len));
|
chunk_create(buf, len));
|
||||||
|
src->destroy(src);
|
||||||
if (!packet)
|
if (!packet)
|
||||||
{
|
{
|
||||||
DBG1(DBG_NET, "failed to parse DNS response");
|
DBG1(DBG_NET, "failed to parse DNS response");
|
||||||
@@ -349,6 +350,7 @@ METHOD(android_dns_proxy_t, handle, bool,
|
|||||||
DBG1(DBG_NET, "sending DNS request failed: %s", strerror(errno));
|
DBG1(DBG_NET, "sending DNS request failed: %s", strerror(errno));
|
||||||
}
|
}
|
||||||
this->lock->unlock(this->lock);
|
this->lock->unlock(this->lock);
|
||||||
|
packet->destroy(packet);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user