Commit 4716a65f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

freeaddrinfo: rewrite as iterative

parent 3180272a
......@@ -34,12 +34,13 @@
*/
void freeaddrinfo (struct addrinfo *res)
{
if (res == NULL)
return;
while (res != NULL)
{
struct addrinfo *next = res->ai_next;
freeaddrinfo (res->ai_next);
free (res->ai_canonname);
free (res->ai_addr);
free (res);
free (res->ai_canonname);
free (res->ai_addr);
free (res);
res = next;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment