ecc: Fix some memory leaks