fix memory leaks in commotiond