(I believe this question is technically distinct from Can a local variable's memory be accessed outside its scope? because it is C instead of C++.)
I know that in C
The C99, 6.2.4 p2 standard says:
If an object is referred to outside of its lifetime, the behavior is undefined. The value of a pointer becomes indeterminate when the object it points to reaches the end of its lifetime.