mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2025-12-07 02:23:49 +00:00
Do not leak rr_name on failures inside ares_parse_a_reply
This commit is contained in:
@ -132,6 +132,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|||||||
aptr += len;
|
aptr += len;
|
||||||
if (aptr + RRFIXEDSZ > abuf + alen)
|
if (aptr + RRFIXEDSZ > abuf + alen)
|
||||||
{
|
{
|
||||||
|
free(rr_name);
|
||||||
status = ARES_EBADRESP;
|
status = ARES_EBADRESP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -149,6 +150,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|||||||
{
|
{
|
||||||
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
||||||
{
|
{
|
||||||
|
free(rr_name);
|
||||||
status = ARES_EBADRESP;
|
status = ARES_EBADRESP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -159,6 +161,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
|
|||||||
struct ares_addrttl * const at = &addrttls[naddrs];
|
struct ares_addrttl * const at = &addrttls[naddrs];
|
||||||
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
if (aptr + sizeof(struct in_addr) > abuf + alen)
|
||||||
{
|
{
|
||||||
|
free(rr_name);
|
||||||
status = ARES_EBADRESP;
|
status = ARES_EBADRESP;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user