Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ares_parse_a_reply: fix memleak

  • Loading branch information...
commit bffd67f16a8f42fe6dbf79ab2e39d92eea05c8a6 1 parent f2ea96b
@thughes thughes authored committed
Showing with 2 additions and 0 deletions.
  1. +2 −0  ares_parse_a_reply.c
View
2  ares_parse_a_reply.c
@@ -241,6 +241,8 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen,
for (i = 0; i < naddrs; i++)
hostent->h_addr_list[i] = (char *) &addrs[i];
hostent->h_addr_list[naddrs] = NULL;
+ if (!naddrs && addrs)
+ free(addrs);
*host = hostent;
return ARES_SUCCESS;
}
Please sign in to comment.
Something went wrong with that request. Please try again.