Free() pointer to Struct, inside a Struct
问题 I can't seem to find how to free() the sub struct. Structs: typedef struct { char ID[5]; location *loc; } observer; typedef struct { double lat; double lng; } location; My Wrapper of Free() is: void free_obs_list_node(void *data) { free(*(observer **)data); } I can free the observer struct. I cannot free the pointer to the location Struct. This is my question: how do I free the location struct pointed to by location *loc; I used a wrapper of free() as these are node's in a generic linked list