RUBY-611 fixing usage of buffer after deallocation
RUBY-612 fixing usage of new buffer when potentially null