End Google Ads 201810 - BS.net 01 --> So , I have this SDK from a manufacturer. They use malloc in their code..and so I have to use it. They use C along with C++ in their SDK.

They do something like this:-

void *ptr;
ptr=malloc(40*50);

pArrivedFrame->GetBytes(ptr); //The bytes I need are referenced to ptr

and I do:

char *b=(unsigned char*)(pFrame); //This is to get the data.

Now my question is how do i free the void ptr?

free(ptr); does not work and results in an exception being thrown. Any help will be appreciated.

Thanks