Currently I am using Valgrind to check memory leak and take Purify as an alternative. Valgrind can find out the access violation on an array created in heap but not in stack.
char* a = static_cast<char*>(malloc(sizeof(char) * 5));
a[7] = 'c';
printf("%c\n", a[7]);
free(a);
Valgrind points of invalid write and read in the above code, but not the following code.
char a[5] = {0};
a[7] = 'c';
printf("%c\n", a[7]);
Can Purify identify the access violation of the both blocks of code?