mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1183954, Don't leak nsStructuredCloneContainer (use of 'auto' is error prone), r=leak
This commit is contained in:
parent
8579f450a0
commit
cb6eb89bc1
@ -1972,7 +1972,8 @@ Notification::GetData(JSContext* aCx,
|
||||
{
|
||||
if (mData.isNull() && !mDataAsBase64.IsEmpty()) {
|
||||
nsresult rv;
|
||||
auto container = new nsStructuredCloneContainer();
|
||||
nsRefPtr<nsStructuredCloneContainer> container =
|
||||
new nsStructuredCloneContainer();
|
||||
rv = container->InitFromBase64(mDataAsBase64, JS_STRUCTURED_CLONE_VERSION,
|
||||
aCx);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
@ -2008,7 +2009,8 @@ Notification::InitFromJSVal(JSContext* aCx, JS::Handle<JS::Value> aData,
|
||||
if (!mDataAsBase64.IsEmpty() || aData.isNull()) {
|
||||
return;
|
||||
}
|
||||
auto dataObjectContainer = new nsStructuredCloneContainer();
|
||||
nsRefPtr<nsStructuredCloneContainer> dataObjectContainer =
|
||||
new nsStructuredCloneContainer();
|
||||
aRv = dataObjectContainer->InitFromJSVal(aData, aCx);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
return;
|
||||
@ -2025,7 +2027,8 @@ void Notification::InitFromBase64(JSContext* aCx, const nsAString& aData,
|
||||
}
|
||||
|
||||
// To and fro to ensure it is valid base64.
|
||||
auto container = new nsStructuredCloneContainer();
|
||||
nsRefPtr<nsStructuredCloneContainer> container =
|
||||
new nsStructuredCloneContainer();
|
||||
aRv = container->InitFromBase64(aData, JS_STRUCTURED_CLONE_VERSION,
|
||||
aCx);
|
||||
if (NS_WARN_IF(aRv.Failed())) {
|
||||
|
Loading…
Reference in New Issue
Block a user