mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-22 14:49:20 -04:00
Fix double frees in getaddrinfo() in libirs (#40209)
This commit is contained in:
parent
984d2bb9e5
commit
d7262e5c86
2 changed files with 5 additions and 7 deletions
3
CHANGES
3
CHANGES
|
|
@ -1,3 +1,6 @@
|
|||
4179. [bug] Fix double frees in getaddrinfo() in libirs.
|
||||
[RT #40209]
|
||||
|
||||
4178. [bug] Fix assertion failure in parsing UNSPEC(103) RR from
|
||||
text. [RT #40274]
|
||||
|
||||
|
|
|
|||
|
|
@ -1139,10 +1139,8 @@ add_ipv4(const char *hostname, int flags, struct addrinfo **aip,
|
|||
UNUSED(flags);
|
||||
|
||||
ai = ai_clone(*aip, AF_INET); /* don't use ai_clone() */
|
||||
if (ai == NULL) {
|
||||
_freeaddrinfo(*aip);
|
||||
if (ai == NULL)
|
||||
return (EAI_MEMORY);
|
||||
}
|
||||
|
||||
*aip = ai;
|
||||
ai->ai_socktype = socktype;
|
||||
|
|
@ -1262,11 +1260,8 @@ ai_clone(struct addrinfo *oai, int family) {
|
|||
ai = ai_alloc(family, ((family == AF_INET6) ?
|
||||
sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in)));
|
||||
|
||||
if (ai == NULL) {
|
||||
if (oai != NULL)
|
||||
freeaddrinfo(oai);
|
||||
if (ai == NULL)
|
||||
return (NULL);
|
||||
}
|
||||
if (oai == NULL)
|
||||
return (ai);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue