indentation
removed dead assignment
free buffer on device close