mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1246157 - avoid memory leak when bindings->init fails. r=jcoppeard
This commit is contained in:
parent
f322e3ac40
commit
5027f4c4e1
@ -591,6 +591,7 @@ ModuleObject::create(ExclusiveContext* cx, Handle<StaticScope*> enclosingStaticS
|
||||
IndirectBindingMap* bindings = zone->new_<IndirectBindingMap>(zone);
|
||||
if (!bindings || !bindings->init()) {
|
||||
ReportOutOfMemory(cx);
|
||||
js_delete<IndirectBindingMap>(bindings);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@ -842,6 +843,7 @@ ModuleObject::createNamespace(JSContext* cx, HandleModuleObject self, HandleArra
|
||||
IndirectBindingMap* bindings = zone->new_<IndirectBindingMap>(zone);
|
||||
if (!bindings || !bindings->init()) {
|
||||
ReportOutOfMemory(cx);
|
||||
js_delete<IndirectBindingMap>(bindings);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user