Hi All
I have a question related to free().
For example
A(char *buffer) call B(char *buffer)
B(char *buffer) in turn calls C(char *buffer)
C(char *buffer) in turn calls D(char *buffer)
D(char *buffer) in turn calls E(char *buffer)
and so on.........
I pass a pointer as a parameter from A()
A(char *buffer);
1) This buffer was freed somewhere in some function. (Deallocation could have done by B() or C() or D() or E() etc)
2) I did not set BUFFER=NULL after freeing up the buffer in any of the function.
Is there any way to know whether buffer was FREED or NOT when I return to A().
I believe BUFFER will be pointing to the location even if we free() the data.
Please let me know your response.
Thanks & Regards
Sathish Kumar
I have a question related to free().
For example
A(char *buffer) call B(char *buffer)
B(char *buffer) in turn calls C(char *buffer)
C(char *buffer) in turn calls D(char *buffer)
D(char *buffer) in turn calls E(char *buffer)
and so on.........
I pass a pointer as a parameter from A()
A(char *buffer);
1) This buffer was freed somewhere in some function. (Deallocation could have done by B() or C() or D() or E() etc)
2) I did not set BUFFER=NULL after freeing up the buffer in any of the function.
Is there any way to know whether buffer was FREED or NOT when I return to A().
I believe BUFFER will be pointing to the location even if we free() the data.
Please let me know your response.
Thanks & Regards
Sathish Kumar
Comment