Browse Source

* A missing freeaddrinfo() maybe?

svn: 1129
Bryan Drewery 22 years ago
parent
commit
882a00a187
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/net.c

+ 3 - 1
src/net.c

@@ -135,8 +135,10 @@ int get_ip(char *hostname, union sockaddr_union *so)
   egg_memset(&hints, 0, sizeof(struct addrinfo));
   hints.ai_socktype = SOCK_STREAM;
 
-  if ((error = getaddrinfo(hostname, NULL, &hints, &res)))
+  if ((error = getaddrinfo(hostname, NULL, &hints, &res))) {
+    freeaddrinfo(res);
     return error;
+  }
 
   error = 1;
   for (ai = res; ai != NULL; ai = ai->ai_next) {