I have a pointer and by default it carries NULL then it waits for some event and gets a value if the event happens, later I am freeing the pointer somewhere else but even after freeing the pointer I am not making it NULL so it still keeps referencing the same memory location and I know the next malloc call might allocate that memory chunk to some other memory request!
pointer_type *p = NULL;
while (process_get_wakeup(//some logic//)) {
while ((qelem = (void*)process_dequeue(//some logic//)) != NULL) {
p = (pointer_type *)qelem;
}
.
.
//goes into a loop of calls where free(p) is also done!
.
.
//Printing value of p as %p gives this : 0xFF00000000
EDIT : I already know it not how we are supposed to do it, and I can't expect to retain the same value as that might be used for something else now, but what I want to know is why only a particular value of p is seen by me!
Does this value : 0xFF00000000 render any special meaning ?