Bug 1486690 - Remove unnecessary checks after moz_xmalloc() calls. r=glandium

There are surprisingly many of them.

(Plus a couple of unnecessary checks after `new` calls that were nearby.)
This commit is contained in:
Nicholas Nethercote
2018-08-28 15:56:01 +10:00
parent 6476cdb576
commit cd127441a0
53 changed files with 105 additions and 335 deletions

View File

@@ -230,7 +230,6 @@ nsUrlClassifierPrefixSet::GetPrefixes(uint32_t* aCount,
uint64_t itemCount = prefixes.Length();
uint32_t* prefixArray = static_cast<uint32_t*>(moz_xmalloc(itemCount * sizeof(uint32_t)));
NS_ENSURE_TRUE(prefixArray, NS_ERROR_OUT_OF_MEMORY);
memcpy(prefixArray, prefixes.Elements(), sizeof(uint32_t) * itemCount);