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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user