Bug 1696353 - Remove redundant nullptr checks of return value of infallible new in toolkit/mozapps/defaultagent. r=bytesized

Depends on D107183

Differential Revision: https://phabricator.services.mozilla.com/D107184
This commit is contained in:
Simon Giesecke 2021-03-10 21:08:14 +00:00
Родитель 5cbabe2bca
Коммит 15135278cc
2 изменённых файлов: 0 добавлений и 8 удалений

Просмотреть файл

@ -196,9 +196,6 @@ HRESULT RegisterTask(const wchar_t* uniqueToken,
mozilla::UniquePtr<wchar_t[]> timeStr =
mozilla::MakeUnique<wchar_t[]>(kTimeStrMaxLen + 1);
if (!timeStr) {
return E_OUTOFMEMORY;
}
if (wcsftime(timeStr.get(), kTimeStrMaxLen + 1, kTimeFormat, &now_tm) ==
0) {

Просмотреть файл

@ -102,11 +102,6 @@ static TelemetryFieldResult GetOSLocale() {
nullptr, nullptr);
mozilla::UniquePtr<char[]> narrowLocaleName =
mozilla::MakeUnique<char[]>(bufLen);
if (!narrowLocaleName) {
HRESULT hr = HRESULT_FROM_WIN32(ERROR_OUTOFMEMORY);
LOG_ERROR(hr);
return TelemetryFieldResult(mozilla::WindowsError::FromHResult(hr));
}
WideCharToMultiByte(CP_UTF8, 0, localeName, -1, narrowLocaleName.get(),
bufLen, nullptr, nullptr);