umat: fix memory leaks