genesys: Use C++ containers to remove chances of memory leaks
This PR replaces almost all uses of malloc
/free
with C++ std::vector
and std::list
containers. More than 20 memory leaks have been identified in the process and fixed. The use of C++ containers will make further memory leaks almost impossible.