OSError memory leak