mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-12 23:09:59 -04:00
Fix double frees in getaddrinfo() in libirs (#40209)
(cherry picked from commitd7262e5c86) (cherry picked from commitcec7b98404)
This commit is contained in:
parent
0ada9e238a
commit
4abc820714
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]
|
||||
|
||||
|
|
|
|||
|
|
@ -1138,10 +1138,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;
|
||||
|
|
@ -1261,11 +1259,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