You're using C++ (template) classes like std::string. You cannot use malloc with them - you need to allocate memory in the C++ way, using new (and delete to free them).
To elaborate on MikeyBoy's answer, consider a class with a constructor and destructor. If you allocate space for them with malloc(), the constructor won't get called. And if you use free() to deallocate, the destructor won't get called.
Also, you have a prev pointer but you don't use it. Either remove the prev pointer or use it.