Code: scoped_refptr<BrowserContext> BrowserContextImpl::GetOffTheRecordContext() {
   if (!otr_context_) {
    OTRBrowserContextImpl* context = new OTRBrowserContextImpl(
        this,
        static_cast<BrowserContextIODataImpl *>(io_data()));
    otr_context_ = context->GetWeakPtr();
   }
 
  return make_scoped_refptr(otr_context_.get());
 }

Commit Message: 
CWE ID: CWE-20
scoped_refptr<BrowserContext> BrowserContextImpl::GetOffTheRecordContext() {
BrowserContext* BrowserContextImpl::GetOffTheRecordContext() {
   if (!otr_context_) {
    otr_context_ =
        base::MakeUnique<OTRBrowserContextImpl>(
            this,
            static_cast<BrowserContextIODataImpl*>(io_data()));
   }
 
  return otr_context_.get();
}

BrowserContextImpl::~BrowserContextImpl() {
  CHECK(!otr_context_);
 }
