Merge "Fix potential use-after-free issue" into rvc-dev am: 557bdaa8d2 am: 282b2897ed am: 95a1d0514b

Change-Id: Ic38e39c6b3a7159c02886e7712ab023ff54fc2f2