[mms_task_encode] Fixed memory leak