I think we could not need to move and free something here. 
1. line 782 is just to copy the context pointer to mediaengine->m_pCodecCtxs[0], and this address will not not be changed during this whole function InitPmp as well as decoding process.
2. CodecCtxs will be freed in MediaEngine::closeContext(), so we do not need to free it here.