config: fix memory leak