cppdap: Donot freeaddrinfo(nullptr)
freeaddrinfo(3) only defined to free one or more addrinfo structures returned by getaddrinfo(3). Thus, it's undefined behaviour for calling freeaddrinfo(3) on nullptr, some libc only call free(3) on the the passed addrinfo, but other libc assumes the addrinfo is always valid.
Let's be explicit instead of relying on undefined behaviours.
Let's drop first call to freeaddrinfo(3) because the addrinfo there is always nullptr and guard the second.
Backport-from: https://github.com/google/cppdap/pull/118
Edited by Đoàn Trần Công Danh