fix memory leak in switch drivers (patch from #1132)