From c57372345fd61e38ed16e4e6aa14f165ec99252e Mon Sep 17 00:00:00 2001 From: David Zbarsky Date: Thu, 2 May 2013 22:02:40 -0400 Subject: [PATCH] Bug 867459 - Fix storage rooting hazards r=terrence --- storage/src/mozStorageAsyncStatementJSHelper.cpp | 4 ++-- storage/src/mozStorageStatementJSHelper.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/storage/src/mozStorageAsyncStatementJSHelper.cpp b/storage/src/mozStorageAsyncStatementJSHelper.cpp index 32a155d4629d..cb7ef475994e 100644 --- a/storage/src/mozStorageAsyncStatementJSHelper.cpp +++ b/storage/src/mozStorageAsyncStatementJSHelper.cpp @@ -55,8 +55,8 @@ AsyncStatementJSHelper::getParams(AsyncStatement *aStatement, NS_ENSURE_SUCCESS(rv, rv); } - JSObject *obj = nullptr; - rv = aStatement->mStatementParamsHolder->GetJSObject(&obj); + JS::Rooted obj(aCtx); + rv = aStatement->mStatementParamsHolder->GetJSObject(obj.address()); NS_ENSURE_SUCCESS(rv, rv); *_params = OBJECT_TO_JSVAL(obj); diff --git a/storage/src/mozStorageStatementJSHelper.cpp b/storage/src/mozStorageStatementJSHelper.cpp index 18a70f2e85e1..de1efec3ecb2 100644 --- a/storage/src/mozStorageStatementJSHelper.cpp +++ b/storage/src/mozStorageStatementJSHelper.cpp @@ -108,8 +108,8 @@ StatementJSHelper::getRow(Statement *aStatement, NS_ENSURE_SUCCESS(rv, rv); } - JSObject *obj = nullptr; - rv = aStatement->mStatementRowHolder->GetJSObject(&obj); + JS::Rooted obj(aCtx); + rv = aStatement->mStatementRowHolder->GetJSObject(obj.address()); NS_ENSURE_SUCCESS(rv, rv); *_row = OBJECT_TO_JSVAL(obj); @@ -147,8 +147,8 @@ StatementJSHelper::getParams(Statement *aStatement, NS_ENSURE_SUCCESS(rv, rv); } - JSObject *obj = nullptr; - rv = aStatement->mStatementParamsHolder->GetJSObject(&obj); + JS::Rooted obj(aCtx); + rv = aStatement->mStatementParamsHolder->GetJSObject(obj.address()); NS_ENSURE_SUCCESS(rv, rv); *_params = OBJECT_TO_JSVAL(obj);