Quote Originally Posted by leGrandNono View Post
I try to fill the parent structure with a memcpy. I work on embedded system (with Contiki OS). So I try to avoid using a malloc because I read that it is not recommended.
If parent_t contains a pointer to a child_t rather than an instance of a child_t, then you have to create the memory space for the child_t somehow. That can be by using malloc, or if you don't want to use malloc() you could have a global array of child_t's you allocate from using your own function.

But you can't just leave the pointer dangling. It must either be NULL or point to valid memory.