During construction of Part and its derived classes, strings are given as parameters. These are copied by allocating memory and copying the string into it. The dynamically allocated char arrays are referenced by a header-declared pointer variable, but (presumably) not automatically freed on destruction. In order to ensure memory integrity, all calls to malloc() in the constructor should be matched by calls to free() in the destructor.
During construction of Part and its derived classes, strings are given as parameters. These are copied by allocating memory and copying the string into it. The dynamically allocated char arrays are referenced by a header-declared pointer variable, but (presumably) not automatically freed on destruction. In order to ensure memory integrity, all calls to malloc() in the constructor should be matched by calls to free() in the destructor.