buffer is released in the outer exception handler