ABR for new in purify C++

Code :

vector<char> ab; //Assume it may or may not have data.

size = ab.size();
char* ch = NULL;
if ( size > 0 )
{
ch = new ch(size); // Purify is throwing ABR for this line.
}

Can anyone help what could be the issue?

Same kind of allocation is present twice. For 1st its not showing the error and for second its showing error.



ch = new ch(size); // Purify is throwing ABR for this line.
I expect you meant
ch = new char[size];
yes its ch = new char[size];
Last edited on
Topic archived. No new replies allowed.