Bug 1276724 - Make two url-classifier allocations fallible. r=gcp.
This addresses two crashes in the top #75 on 47.0.1.
This commit is contained in:
@@ -787,7 +787,9 @@ HashStore::WriteAddPrefixes(nsIOutputStream* aOut)
|
||||
{
|
||||
nsTArray<uint32_t> chunks;
|
||||
uint32_t count = mAddPrefixes.Length();
|
||||
chunks.SetCapacity(count);
|
||||
if (!chunks.SetCapacity(count, fallible)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
chunks.AppendElement(mAddPrefixes[i].Chunk());
|
||||
|
||||
Reference in New Issue
Block a user