Hi
how is the best way to free unsigned pointer array allocated with cmallc?
Code:
uint8_t *buf;
buf = cs_calloc(ca->len + 13);
i do like this , but i know this is not quite right , since i got compile warning :
warning: passing argument 1 of ‘free’ makes pointer from integer without a cast
Code:
for (i = 0; i < ca->len + 13; i++)
{
free(buf[i]);
buf[i] = NULL;
}
free(buf);
do i need to free each element of array like above? do i need to fill with null after same as above ? would appreciate someone correct how i wrote free
Thanks in advance