Doc update
Ensure that the buffer is destroyed even in the event of an error.