mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
Merge pull request #121 from azat/dns-regress-leaks
regress_dns: fix leaks in getaddrinfo_async{,_cancel_stress} tests
This commit is contained in:
commit
6066f985cc
@ -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);
|
||||
}
|
||||
@ -1875,6 +1876,8 @@ end:
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user