ABR for new in purify C++

Oct 8, 2012 at 3:48pm
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.



Oct 8, 2012 at 4:03pm
ch = new ch(size); // Purify is throwing ABR for this line.
I expect you meant
ch = new char[size];
Oct 9, 2012 at 7:43am
yes its ch = new char[size];
Last edited on Oct 9, 2012 at 7:43am
Topic archived. No new replies allowed.