зеркало из https://github.com/mozilla/gecko-dev.git
Bug 303432 - nsPrintSettings::GetPrinterName lacks an OOM check
patch by b.jacques@planet.nl r=dmose sr=dmose
This commit is contained in:
Родитель
d51e75e35f
Коммит
cc66211822
|
@ -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)) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче