I've done alot of looking around, but still can't get my head around it, lets say I have struct:

```
struct some_struct {
    int x;
    int y;
    char *some_string;
};

```

Lets say we have the above struct, how would you allocate some memory for the above struct?
One can simply do:

```
struct some_struct *test_struct;
test_struct = malloc(sizeof(struct some_struct));

```

But is this enough? Don't you need to allocate some memory for `some_string`? Or if the struct contains more pointers, do you not need to allocate memory for them as well?

**Edit**: One more thing... assuming my struct `some_struct` already has data in it e.g.

```
struct some_struct *test_struct = malloc(sizeof(some_string);
test_struct->x = 2;
test_struct->y = 3;
test_struct->some_string = "sadlfkajsdflk";

```

Will the following code suffice in freeing allocated memory?

```
free(test_struct);

```

or do I have to go in and free the char\* some\_string as well?

Thanks