Skip to content

Commit

Permalink
Merge pull request libevent#121 from azat/dns-regress-leaks
Browse files Browse the repository at this point in the history
regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests
  • Loading branch information
nmathewson committed Mar 26, 2014
2 parents 8163b1a + 2fdc5f2 commit 6066f98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/regress_dns.c
Expand Up @@ -1563,7 +1563,8 @@ test_getaddrinfo_async(void *arg)
end:
if (local_outcome.ai)
evutil_freeaddrinfo(local_outcome.ai);
for (i=0;i<10;++i) {
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
for (i=0;i<(int)ARRAY_SIZE(a_out);++i) {
if (a_out[i].ai)
evutil_freeaddrinfo(a_out[i].ai);
}
Expand Down Expand Up @@ -1875,6 +1876,8 @@ test_getaddrinfo_async_cancel_stress(void *ptr)
evdns_base_free(dns_base, 1);
if (server)
evdns_close_server_port(server);
if (base)
event_base_free(base);
if (fd >= 0)
evutil_closesocket(fd);
}
Expand Down

0 comments on commit 6066f98

Please sign in to comment.