cleaned initialization memory leaks found in C driver program