mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-18 23:15:38 +00:00
Bug 829421 - Free ArgumentsData if JSObject allocation fails. r=nbp
This commit is contained in:
parent
f597024e7a
commit
1882366688
@ -161,8 +161,10 @@ ArgumentsObject::create(JSContext *cx, HandleScript script, HandleFunction calle
|
||||
ClearAllBitArrayElements(data->deletedBits, numDeletedWords);
|
||||
|
||||
RawObject obj = JSObject::create(cx, FINALIZE_KIND, shape, type, NULL);
|
||||
if (!obj)
|
||||
if (!obj) {
|
||||
cx->free_(data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
obj->initFixedSlot(INITIAL_LENGTH_SLOT, Int32Value(numActuals << PACKED_BITS_COUNT));
|
||||
obj->initFixedSlot(DATA_SLOT, PrivateValue(data));
|
||||
|
Loading…
x
Reference in New Issue
Block a user