Pointers are only addresses. The address they point on can be allocated or not. What you've to understand from this sentence is that each "malloc" must have its only one "free" on the same address, which is not necessary the same pointers.
With an example:
Code:
B1 = malloc(sizeof(B));
A* A1 = malloc (sizeof (A));
A1->b= malloc (100);
B1->A1 = A1; /* B1->A1 and A1 are 2 different pointers on the same address */
char* e = malloc (sizeof (1000));
B1->d = e;
You can un-allocate these with:
free (A1->b); /* or free (B1->A1->b), but not the two */
free (A1); /* or free (B1->A1, but not the two) */
You can't freeing A1 then A1->b since after free (A1), the pointer A1->b doesn't exist anymore, but the address it points on is always allocated, it's a memory leak! For B1, you can free (B1) then free (e), or free (B1->d) then free (B1), but not free (B1), then free (B1->d).