]> git.ozlabs.org Git - ccan/commitdiff
net: fix leak in test.
authorRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Oct 2013 08:23:26 +0000 (17:53 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 2 Oct 2013 08:23:26 +0000 (17:53 +0930)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ccan/net/test/run-bind.c

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