I am working on a VC++ 6.0 program. For some reason I keep getting this assert error.
Program : SERVER.EXE
File : dbgdel.cpp
Line : 47
Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
I looked around and it seems to be caused by one of three main things:
1) Deleting data from a DLL allocated in a EXE.
2) Accessing past the arrays allocated amount.
3) Trying to delete an array without the [] on the delete.
Here is the code for the lifetime of the varible:
char* temp_select = new char[39];
temp_select = "SELECT * FROM users WHERE username = ";
ZeroMemory(message,37+1+strlen(verification_msg->username)+1+16+1+strlen(verification_msg->password)+1+5);
strcat(message, temp_select);
strcat(message, quotation_mark);
strcat(message, verification_msg->username);
strcat(message, quotation_mark);
strcat(message, " AND password = ");
strcat(message, quotation_mark);
strcat(message, verification_msg->password);
strcat(message, quotation_mark);
// Now we kill temp quote
delete quotation_mark;
if (FAILED(hr=SQL_Query(message))) { DX_ERROR(hr);}
// Now we can kill the messages
delete[] temp_select;
The assertion error is caused by the last line. All SQL_QUERY does is use a DLL to query a SQL database. It is not affecting temp_select at all.
Any ideas on what the problem is?
I seek the Codemaster Talon.