diff --git a/components/brave_shields/browser/tracking_protection_service.cc b/components/brave_shields/browser/tracking_protection_service.cc index 7006da0986d0..03bb6fcce287 100644 --- a/components/brave_shields/browser/tracking_protection_service.cc +++ b/components/brave_shields/browser/tracking_protection_service.cc @@ -320,10 +320,10 @@ std::vector TrackingProtectionService::GetThirdPartyHosts( } } - std::string thirdPartyHosts = + char* thirdPartyHosts = tracking_protection_client_->findFirstPartyHosts(base_host.c_str()); std::vector hosts; - if (!thirdPartyHosts.empty()) { + if (nullptr != thirdPartyHosts) { std::string strThirdPartyHosts = thirdPartyHosts; size_t iPos = strThirdPartyHosts.find(","); while (iPos != std::string::npos) { @@ -335,6 +335,7 @@ std::vector TrackingProtectionService::GetThirdPartyHosts( if (0 != strThirdPartyHosts.length()) { hosts.push_back(strThirdPartyHosts); } + delete []thirdPartyHosts; } {