ecc: fix memory leaks.