mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1031920 - Stop leaking mDataPtr on failure in ArrayBufferBuilder::getArrayBuffer. r=smaug
This commit is contained in:
parent
52e4297e97
commit
70a83130c9
@ -4065,12 +4065,11 @@ ArrayBufferBuilder::getArrayBuffer(JSContext* aCx)
|
||||
}
|
||||
|
||||
JSObject* obj = JS_NewArrayBufferWithContents(aCx, mLength, mDataPtr);
|
||||
mDataPtr = nullptr;
|
||||
mLength = mCapacity = 0;
|
||||
if (!obj) {
|
||||
js_free(mDataPtr);
|
||||
return nullptr;
|
||||
}
|
||||
mDataPtr = nullptr;
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user