Bug 1414737 - Ensure Connection::GetQuotaObjects only returns NS_OK if the quota objects are non-null. r=janv,dom-workers-and-storage-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D60135

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Simon Giesecke 2020-01-23 12:46:46 +00:00
parent 5e4d1b86a6
commit 916d2ad550

View File

@ -2264,6 +2264,9 @@ Connection::GetQuotaObjects(QuotaObject** aDatabaseQuotaObject,
}
RefPtr<QuotaObject> databaseQuotaObject = GetQuotaObjectForFile(file);
if (NS_WARN_IF(!databaseQuotaObject)) {
return NS_ERROR_FAILURE;
}
srv = ::sqlite3_file_control(mDBConn, nullptr, SQLITE_FCNTL_JOURNAL_POINTER,
&file);
@ -2272,6 +2275,9 @@ Connection::GetQuotaObjects(QuotaObject** aDatabaseQuotaObject,
}
RefPtr<QuotaObject> journalQuotaObject = GetQuotaObjectForFile(file);
if (NS_WARN_IF(!journalQuotaObject)) {
return NS_ERROR_FAILURE;
}
databaseQuotaObject.forget(aDatabaseQuotaObject);
journalQuotaObject.forget(aJournalQuotaObject);