Fix references to already freed buffer.