A
Alfonso Morra
Hi,
I've defined the ff structs:
struct _my_nested_data {
int size;
void *data;
};
typedef struct {
int check;
int size_1;
int size_2;
struct _my_nested_data *curr;
} ParentData;
In my code I correctly allocate memory to a ptr to ParentData struct,
and use the variable succesfully. However, whe I want to free this
variable (type = ParentData*), I do so using
free(variable_name) and I get a crash. Do I need to free the nested
struct first?
I've defined the ff structs:
struct _my_nested_data {
int size;
void *data;
};
typedef struct {
int check;
int size_1;
int size_2;
struct _my_nested_data *curr;
} ParentData;
In my code I correctly allocate memory to a ptr to ParentData struct,
and use the variable succesfully. However, whe I want to free this
variable (type = ParentData*), I do so using
free(variable_name) and I get a crash. Do I need to free the nested
struct first?