Fix a place where we were referencing a pointer after it had been freed.