cppsp: fixed minor memory leak & removed unused code