Bug 1496588: Avoid a UB in mozStorageService.cpp. r=froydnj

This commit is contained in:
David Major 2018-10-05 16:23:40 -04:00
parent 4cfa7dac99
commit 5e2560e587

View File

@ -619,8 +619,10 @@ Service::OpenAsyncDatabase(nsIVariant *aDatabaseStore,
return NS_ERROR_INVALID_ARG;
}
rv = storageFile->Clone(getter_AddRefs(storageFile));
nsCOMPtr<nsIFile> cloned;
rv = storageFile->Clone(getter_AddRefs(cloned));
MOZ_ASSERT(NS_SUCCEEDED(rv));
storageFile = cloned.forget();
if (!readOnly) {
// Ensure that SQLITE_OPEN_CREATE is passed in for compatibility reasons.