mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 01:57:00 +00:00
Fix bug #8227/#9841 Deref errors
This commit is contained in:
parent
7e3d90b60c
commit
f32fdfd744
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user