Commit 975c118a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Simplify free

parent c345ce53
...@@ -206,16 +206,12 @@ static void WSAAPI freeaddrinfo (struct addrinfo *res) ...@@ -206,16 +206,12 @@ static void WSAAPI freeaddrinfo (struct addrinfo *res)
static void freeaddrinfo (struct addrinfo *res) static void freeaddrinfo (struct addrinfo *res)
#endif #endif
{ {
if (res != NULL) if (res == NULL)
{ return;
if (res->ai_canonname != NULL) free (res->ai_canonname);
free (res->ai_canonname); free (res->ai_addr);
if (res->ai_addr != NULL) free (res->ai_next);
free (res->ai_addr); free (res);
if (res->ai_next != NULL)
free (res->ai_next);
free (res);
}
} }
......
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