Fixed invalid use of freed memory.

This commit is contained in:
Vincent Richard 2013-02-11 21:10:19 +01:00
parent b02e6ab664
commit f0e12cbadc
2 changed files with 4 additions and 2 deletions

View File

@ -216,8 +216,9 @@ const vmime::string posixHandler::getHostName() const
{ {
if (isFQDN(p->ai_canonname)) if (isFQDN(p->ai_canonname))
{ {
const string ret(p->ai_canonname);
freeaddrinfo(info); freeaddrinfo(info);
return p->ai_canonname; return ret;
} }
} }

View File

@ -241,8 +241,9 @@ const vmime::string windowsHandler::getHostName() const
{ {
if (isFQDN(p->ai_canonname)) if (isFQDN(p->ai_canonname))
{ {
const string ret(p->ai_canonname);
freeaddrinfo(info); freeaddrinfo(info);
return p->ai_canonname; return ret;
} }
} }