Ah, now I got it. This a bit strange concept. Under normal circumstances you'd allocate memory for the string when the memory for the struct is allocated as well and you'd release it when the struct memory is released.

The more different parts in your code allocate and release memory on different occasions, the more error prone the code will be concerning memory leaks and or relese of already released memory blocks.


Always learn from history, to be sure you make the same mistakes again...