Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
posix/dns: Fix SEGV on Musl when an error happens
When an error happens, the 'struct addrinfo' (ai) passed to 'passToDNSCallback' can be 'null'. It end up being passed to 'freeaddrinfo'. With glibc, or on OSX, it is okay to pass a 'null' pointer to 'freeaddrinfo', however this will cause a SIGSEGV on Musl. The standard defines that 'freeaddrinfo' must accept what was given to 'getaddrinfo', and 'getaddrinfo' does not accept null pointer, so the musl behavior is not wrong per se.
- Loading branch information