If you’re talking about checking if the function has played its role correctly then you don’t need to check anything, it always has, there’s no way it fails to be by a catastrophic situation on the machine, which makes your application and who knows something else become unviable, and the least of your problems is whether the free()
worked. Or you may not have done what you expect because you called it wrong, for example passing something that is not a pointer or is a wrong pointer.
If you’re talking about determining whether you used the function correctly, there’s no way, you have to analyze the code deeply, or test all possibilities, which can be many, to find it, there’s no way the function itself.
And if you’re talking about releasing an allocation right, then your only chance beyond manual checking is to use some tool that tracks all allocations and shows when there is some abnormality. It’s not 100% safe but it helps a lot. One of them is Valgrind or Drmemory or Insure++.
If you try to use the value of the variable that was released you will have a undefined behavior because it no longer has a valid value. The variable that defined the pointer no longer has a valid value, so it can no longer access. The value remains the same. In C the programmer has to take care of this and not try to access what was valid just before, has no ease in language or library.