Frontport r9650

"Add a error message about not being able to (re)allocate a string"

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9706 4a71c877-e1ca-e34f-864e-861f7616d084
master
Buginator 2010-02-07 04:51:45 +00:00 committed by Git SVN Gateway
parent a6d88bda6b
commit 6a083086e2
1 changed files with 3 additions and 0 deletions

View File

@ -160,7 +160,10 @@ static void insertChar(utf_32_char **pBuffer, size_t *pBufferAllocated, UDWORD *
/* Buffer is full */ /* Buffer is full */
utf_32_char *newBuffer = realloc(*pBuffer, *pBufferAllocated*2); utf_32_char *newBuffer = realloc(*pBuffer, *pBufferAllocated*2);
if (!newBuffer) if (!newBuffer)
{
debug(LOG_ERROR, "Couldn't realloc() string?");
return; return;
}
*pBuffer = newBuffer; *pBuffer = newBuffer;
*pBufferAllocated *= 2; *pBufferAllocated *= 2;
} }