зеркало из https://github.com/mozilla/pjs.git
Bug 342750 NativeUConvService::GetNativeConverter leaks on failure
p=Ryan Jones <bugs@ryan-jones.com>, r=bsmedberg, sr=dbaron
This commit is contained in:
Родитель
339183164e
Коммит
8368e16819
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче