cmp: remove duplicate free functions