I found the classic new / delete mismatch error in our code base as follows:
char *foo = new char[10]; // do something delete foo; // instead of delete[] foo;
How serious is that? Does this cause a memory leak or error? What are the consequences. We have memory problems, but this does not seem serious enough to explain all our symptoms (a lot of corruption, etc.).
EDIT: Additional Questions for Clarity
Does it just free the first member of the array? or
Is the system losing control of the array because of this? or
Is corrupt memory a way?
c ++ new-operator delete-operator
user236520 Feb 11 '12 at 8:00 2012-02-11 08:00
source share