|
-
October 22nd, 2003, 05:50 AM
#1
Error Deleting BYTE Array
This is code where I have got assertion on deleting memory
This code ran scuccessfully about 1000 times but after about 4-5 hours of excution I got assertion on deleting GlobalpBuffer
if ( GlobalpBuffer != NULL )
{
delete [] GlobalpBuffer;
GlobalpBuffer = NULL;
}
Assertion occured in file "DBGHEAP.C" on these statements
/* if we didn't already check entire heap, at least check this object */
if (!(_crtDbgFlag & _CRTDBG_CHECK_ALWAYS_DF))
{
/* check no-mans-land gaps */
if (!CheckBytes(pHead->gap, _bNoMansLandFill, nNoMansLandSize))
_RPT3(_CRT_ERROR, "DAMAGE: before %hs block (#%d) at 0x%08X.\n",
szBlockUseName[_BLOCK_TYPE(pHead->nBlockUse)],
pHead->lRequest,
(BYTE *) pbData(pHead));
if (!CheckBytes(pbData(pHead) + pHead->nDataSize, _bNoMansLandFill, nNoMansLandSize))
_RPT3(_CRT_ERROR, "DAMAGE: after %hs block (#%d) at 0x%08X.\n",
szBlockUseName[_BLOCK_TYPE(pHead->nBlockUse)],
pHead->lRequest,
(BYTE *) pbData(pHead));
}
what might have been the cause how could I make this code more secure..........?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|