regarding free



Hi Everyone,

int main()
{
char *p = malloc(100);
p = "india"; //assuming p is not null
p++;
free(p);
}

How would free() behave when the address passed is different from the
one that was allocated... would it fail? would it be a memory leak?

.



Relevant Pages