Browse Source

net: fix leak in test.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 12 years ago
parent
commit
3e9d2361ce
1 changed files with 2 additions and 0 deletions
  1. 2 0
      ccan/net/test/run-bind.c

+ 2 - 0
ccan/net/test/run-bind.c

@@ -117,6 +117,7 @@ int main(void)
 	close(fd);
 	close(fd);
 	for (i = 0; i < num_fds; i++)
 	for (i = 0; i < num_fds; i++)
 		close(fds[i]);
 		close(fds[i]);
+	freeaddrinfo(addr);
 
 
 	/* Simple UDP test. */
 	/* Simple UDP test. */
 	addr = net_server_lookup(TEST_PORT, AF_UNSPEC, SOCK_DGRAM);
 	addr = net_server_lookup(TEST_PORT, AF_UNSPEC, SOCK_DGRAM);
@@ -155,6 +156,7 @@ int main(void)
 	if (addr->ai_next)
 	if (addr->ai_next)
 		ipv6_only = true;
 		ipv6_only = true;
 #endif
 #endif
+	freeaddrinfo(addr);
 
 
 	if (ipv6_only) {
 	if (ipv6_only) {
 		int j;
 		int j;