Fix bug #8227/#9841 Deref errors

This commit is contained in:
tague%netscape.com 1999-07-14 19:41:17 +00:00
Родитель a4827eaa9c
Коммит 558d170697
1 изменённых файлов: 12 добавлений и 4 удалений

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

@ -76,8 +76,12 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
if (aClass.Equals(kLocaleFactoryCID))
{
nsLocaleFactory *factory = new nsLocaleFactory();
if(nsnull == factory)
return NS_ERROR_OUT_OF_MEMORY;
if (NULL==factory)
{
*aFactory=NULL;
return NS_ERROR_OUT_OF_MEMORY;
}
res = factory->QueryInterface(kILocaleFactoryIID, (void **) aFactory);
if (NS_FAILED(res))
@ -92,8 +96,12 @@ extern "C" NS_EXPORT nsresult NSGetFactory(nsISupports* serviceMgr,
if (aClass.Equals(kMacLocaleFactoryCID))
{
nsMacLocaleFactory *mac_factory = new nsMacLocaleFactory();
if(nsnull == mac_factory)
return NS_ERROR_OUT_OF_MEMORY;
if (NULL==mac_factory)
{
*aFactory=NULL;
return NS_ERROR_OUT_OF_MEMORY;
}
res = mac_factory->QueryInterface(kIFactoryIID,(void**) aFactory);
if (NS_FAILED(res))