Apparently all documentation for getaddrinfo() advises to call freeaddrinfo() to free resources that were dynamically allocated.
I was able to verify the leak on Windows as I haven't tested it on other systems.
On Windows, creating a local DNS server that returns A and AAAA queries for 127.0.0.1 and ::1, respectively, I found that resolveTAddress() leaks approximately 2MB, 4MB, and 6MB, for 10,000, 20,000, and 30,000 queries, respectively. Something that doesn't happen by calling freeAddrInfo().
Therefore, a program that runs without interruption will be leaking memory after each resolveTAddress() call.
Apparently all documentation for
getaddrinfo()
advises to callfreeaddrinfo()
to free resources that were dynamically allocated.I was able to verify the leak on Windows as I haven't tested it on other systems.
On Windows, creating a local DNS server that returns A and AAAA queries for 127.0.0.1 and ::1, respectively, I found that
resolveTAddress()
leaks approximately 2MB, 4MB, and 6MB, for 10,000, 20,000, and 30,000 queries, respectively. Something that doesn't happen by callingfreeAddrInfo()
.Therefore, a program that runs without interruption will be leaking memory after each
resolveTAddress()
call.