ABR for new in purify C++

vijkrr (73)
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.



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