Merge "Fix use-after-free issue caught by ASAN." into oc-dev
am: 6e03e0e348

Change-Id: I0703e88bfc8b28268b6773b4f3da7c4c51ddd765