Merge "Fix a use-after-free found by HWAsan." am: 82cf8de1f3
am: 2557458766

Change-Id: I074b3c035442466b03476dca68987981d570440b