Hi all.
I am developing a RAID configuration tool. As a part of creation of a volume, i am
allocating some memory dynamically , using malloc() function for n number of pointers and later i am trying to free the memory using the free function.
However the free() function throws an exception some times. It shows some hexadecimal address and says that the memory at that location could not be read.
This is not happening in any other platforms like server2003 ,windows xp but only on Vista.
the code some thing like this
Here the value of numdisks is always less than or equal to 8. So there is no chance of freeing an uninitialized pointer.Code:pptr = (struct xyz **) malloc( sizeof(struct xyz *) * 8); ...... // code to create the RAID volume. The 8 pointers that have been allocated memory above, are intialized to some addresses here. ...... for(i=0; i< numdisks; i++) { if(pptr[i]!=NULL) { free(pptr[i]); } }
Please let me know if there is any thing specific to windows vista that is throwing such error message.