Bug 303432 - nsPrintSettings::GetPrinterName lacks an OOM check

patch by b.jacques@planet.nl r=dmose sr=dmose
This commit is contained in:
timeless%mozdev.org 2006-02-07 01:15:23 +00:00
Родитель d51e75e35f
Коммит cc66211822
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -275,9 +275,13 @@ NS_IMETHODIMP nsPrintSettings::SetDownloadFonts(PRBool aDownloadFonts)
NS_IMETHODIMP nsPrintSettings::GetPrinterName(PRUnichar * *aPrinter) NS_IMETHODIMP nsPrintSettings::GetPrinterName(PRUnichar * *aPrinter)
{ {
NS_ENSURE_ARG_POINTER(aPrinter); NS_ENSURE_ARG_POINTER(aPrinter);
*aPrinter = ToNewUnicode(mPrinter); *aPrinter = ToNewUnicode(mPrinter);
NS_ENSURE_TRUE(*aPrinter, NS_ERROR_OUT_OF_MEMORY);
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP nsPrintSettings::SetPrinterName(const PRUnichar * aPrinter) NS_IMETHODIMP nsPrintSettings::SetPrinterName(const PRUnichar * aPrinter)
{ {
if (!aPrinter || !mPrinter.Equals(aPrinter)) { if (!aPrinter || !mPrinter.Equals(aPrinter)) {