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

Change-Id: I520b35131a0cd9fc6416179af43ffacaafe2118a