mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 342750 NativeUConvService::GetNativeConverter leaks on failure
p=Ryan Jones <bugs@ryan-jones.com>, r=bsmedberg, sr=dbaron
This commit is contained in:
parent
a3f2b3c15b
commit
35d1685d44
@ -372,15 +372,13 @@ NativeUConvService::GetNativeConverter(const char* from,
|
||||
{
|
||||
*aResult = nsnull;
|
||||
|
||||
IConvAdaptor* ucl = new IConvAdaptor();
|
||||
nsRefPtr<IConvAdaptor> ucl = new IConvAdaptor();
|
||||
if (!ucl)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
nsresult rv = ucl->Init(from, to);
|
||||
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
NS_ADDREF(*aResult = (nsISupports*)(nsIUnicharEncoder*)ucl);
|
||||
}
|
||||
if (NS_SUCCEEDED(rv))
|
||||
NS_ADDREF(*aResult = ucl);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user