Bug 640201 - If nsGeolocation::Init fails, mGeolocation is not clear and will be returned on subsequent calls. r=jst

This commit is contained in:
Doug Turner 2011-03-23 10:27:51 -07:00
Родитель ca113799ab
Коммит 61b7469f45
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -10990,9 +10990,11 @@ NS_IMETHODIMP nsNavigator::GetGeolocation(nsIDOMGeoGeolocation **_retval)
if (!mGeolocation)
return NS_ERROR_FAILURE;
if (NS_FAILED(mGeolocation->Init(contentDOMWindow)))
if (NS_FAILED(mGeolocation->Init(contentDOMWindow))) {
mGeolocation = nsnull;
return NS_ERROR_FAILURE;
}
NS_ADDREF(*_retval = mGeolocation);
return NS_OK;
}