Test for non-NULL 'ai_canonname', as per MSDN recommendation.

This commit is contained in:
Vincent Richard 2013-08-18 18:11:57 +02:00
parent a64a4b5dbc
commit 54c766e110

View File

@ -245,7 +245,7 @@ const vmime::string windowsHandler::getHostName() const
{ {
for (struct addrinfo* p = info ; p != NULL ; p = p->ai_next) for (struct addrinfo* p = info ; p != NULL ; p = p->ai_next)
{ {
if (isFQDN(p->ai_canonname)) if (p->ai_canonname && isFQDN(p->ai_canonname))
{ {
const string ret(p->ai_canonname); const string ret(p->ai_canonname);
freeaddrinfo(info); freeaddrinfo(info);