It has been claimed that
a compiler is free to reuse the pointer variable for some other purpose after
the reallocbeing freed, so you have no guarantee that it has the same value as it did before
ie
void *p = malloc(42);
uintptr_t address = (uintptr_t)p;
free(p);
// [...] stuff unrelated to p or address
assert((uintptr_t)p == address);
might fail.
C11 annex J.2 reads
The value of a pointer that refers to space deallocated by a call to the free or realloc function is used (7.22.3) [is undefined]
but the annex is of course not normative.
Annex L.3 (which is normative, but optional) tells us that if
The value of a pointer that refers to space deallocated by a call to the free or realloc function is used (7.22.3).
the result is permitted to be critical undefined behaviour.
This confirms the claim, but I'd like to see an appropriate quote from the standard proper instead of the annex.