diff options
Diffstat (limited to 'sal/osl/w32/socket.cxx')
-rw-r--r-- | sal/osl/w32/socket.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx index ba96cc5ed838..9e819beaa61f 100644 --- a/sal/osl/w32/socket.cxx +++ b/sal/osl/w32/socket.cxx @@ -512,7 +512,11 @@ oslHostAddr SAL_CALL osl_createHostAddrByName(rtl_uString *strHostname) { pRet = static_cast<oslHostAddr>( rtl_allocateZeroMemory(sizeof(struct oslHostAddrImpl))); - rtl_uString_newFromStr(&pRet->pHostName, o3tl::toU(pIter->ai_canonname)); + if (pIter->ai_canonname == nullptr) { + rtl_uString_new(&pRet->pHostName); + } else { + rtl_uString_newFromStr(&pRet->pHostName, o3tl::toU(pIter->ai_canonname)); + } pRet->pSockAddr = createSocketAddr(); memcpy(& pRet->pSockAddr->m_sockaddr, pIter->ai_addr, pIter->ai_addrlen); |