don't work on fakeIp buf if mem could not be allocated in XmlDoc::getOutlinkFirstIpVector

This commit is contained in:
Brian Rasmusson
2016-09-30 23:12:27 +02:00
parent ef224d3670
commit ec5e4195cc

@ -10910,7 +10910,10 @@ int32_t **XmlDoc::getOutlinkFirstIpVector () {
if ( *useFakeIps ) {
int32_t need = links->m_numLinks * 4;
m_fakeIpBuf.reserve ( need );
if( !m_fakeIpBuf.reserve ( need ) ) {
log(LOG_WARN,"%s:%s: Could not allocate %" PRId32 " bytes for links", __FILE__, __func__, need);
return NULL;
}
for ( int32_t i = 0 ; i < links->m_numLinks ; i++ ) {
uint64_t h64 = links->getHostHash64(i);
int32_t ip = h64 & 0xffffffff;