fix memory leak when failed to open driver