Use std::vector instead of malloc'd pointer to get automatic freeing of memory. Result was verified by valgrind, which showed one less loss record. I think Jonathan is/was working on this transition but on a larger scale.