Bug 235643 all _CreatePrintSettings leak on failure

patch by baafie@planet.nl r=timeless sr=bz a=asa
This commit is contained in:
timeless%mozdev.org 2006-02-07 01:15:00 +00:00
Родитель 125e1cfc6a
Коммит 2cbd799e61
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -62,9 +62,12 @@ nsPrintOptionsWin::~nsPrintOptionsWin()
/* nsIPrintSettings CreatePrintSettings (); */
nsresult nsPrintOptionsWin::_CreatePrintSettings(nsIPrintSettings **_retval)
{
*_retval = nsnull;
nsPrintSettingsWin* printSettings = new nsPrintSettingsWin(); // does not initially ref count
NS_ASSERTION(printSettings, "Can't be NULL!");
NS_ENSURE_TRUE(printSettings, NS_ERROR_OUT_OF_MEMORY);
return printSettings->QueryInterface(NS_GET_IID(nsIPrintSettings), (void**)_retval); // ref counts
NS_ADDREF(*_retval = printSettings); // ref count
return NS_OK;
}