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

Change-Id: Ia397ea5db31184e8b52ea3686d06a67d76d876e8