Am I managing dynamic memory incorrectly in this function?
Your new and delete[] of tempPointer are fine.
However, your use of C strings and strcpy is suspect. You've not given any indication that getName() is returning null terminated C-strings. If anotherClass::name is not properly null terminated, strcpy will continue copying past the 41 characters allocated for tempPointer.
Use std::string instead of C-strings. Much safer.
Hero::getSize() still does not answer my question about whether your C-strings are properly terminated with a null terminator. strlen, like strcpy will keep scanning memory until it finds a null terminator.