Consider
int main()
{
char* p = malloc(5);
printf("%td", &p[5] - &p[0]); /*one past the end is allowed*/
free(p);
printf("%td", &p[5] - &p[0]); /*I no longer own p*/
}
Is the behaviour of this code defined? Are you allowed to perform pointer arithmetic on an array that you no longer own?