Fix double frees in getaddrinfo() in libirs (#40209)

This commit is contained in:
Mukund Sivaraman 2015-08-14 13:54:03 +05:30
parent 984d2bb9e5
commit d7262e5c86
2 changed files with 5 additions and 7 deletions

View file

@ -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]

View file

@ -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);