FEM & ParFUM libraries suffer from several poor coding practicies
Malloc and new are intermingled here for various local tempories. There is no apparent reason for malloc being used for some int arrays while new is used for others. Using cppcheck I disentangled erroneous frees of new alloced memory and visa-versa. However, if these libraries are renovated for some new production application use, they should be cleaned up to use memory sensibly, strip out dead code, and generally go through a comprehensive overhaul.