Merge "Fix potential use-after-free issue" into rvc-dev