Fix references to already freed buffer.

We still need to figure out how to trigger this.