- Use std::unique_ptr to levarage RAII for managing the allocation in the presence of errors. Change-Id: I55de515bbf72938e1dd09731c5e51f538cf9d34a