question about freeing resources
Given the follow struct for a doubly linked list:
Code:
typedef struct Node {
int value;
struct Node *next;
struct Node *previous;
} nodeT;
When I'm ready to release resources claimed by a nodeT object, do I also need to explicitly free next and previous, or is that automatically taken care of for me by freeing the encapsulating struct reference (i.e. free(node))? If so, is this because they are all occupying the shared space that is requested when memory is allocated using malloc?