Debug Assertion Failed while using Db::stat()
633562May 8 2008 — edited May 9 2008Hi All-
I'm using MS Visual C++ 6.0 on Win XP. Getting "Debug Assertion Failed" dialog with the following info:
File: dbgheap.c
Expression: _CrtIsValidHeapPointer(pUserData)
This happens when I try to free() the memory. Here is the code:
DB_BTREE_STAT* sp = NULL;
if ((m_pdbWK->stat(NULL, &sp, DB_FAST_STAT) == 0))
{
// Do something with sp
}
if (sp) free(sp); //
My question is, am I not supposed to free this memory? I have a feeling since no user defined malloc function is defined, maybe this is free() is not needed.
Can anybody please tell me what is going on?
Thanks.