options/posix: don't free nullptr in freeaddrinfo
@@ -42,11 +42,13 @@ void endservent(void) {
}
void freeaddrinfo(struct addrinfo *ptr) {
+ if (ptr) {
auto buf = (struct mlibc::ai_buf*) ptr - offsetof(struct mlibc::ai_buf, ai);
// this string was allocated by a frg::string
getAllocator().free(ptr->ai_canonname);
free(buf);
}
+}
const char *gai_strerror(int) {
__ensure(!"Not implemented");
