osc: fix memory leak