Added a check for memory allocation failure

This commit is contained in:
Pavol Marko
2004-05-28 11:24:59 +00:00
parent 3d3775ec00
commit 642eb769b2
3 changed files with 12 additions and 1 deletions

View File

@@ -86,6 +86,10 @@ void EventsMngr::NextParam()
{
// copy to tmp
tmp = new MsgDataEntry[m_ParseVaultSize];
if (!tmp)
{
return; // :TODO: Error report !!
}
memcpy(tmp, m_ParseVault, m_ParseVaultSize * sizeof(MsgDataEntry));
tmpSize = m_ParseVaultSize;
delete [] m_ParseVault;