diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp index 0465a864b9d..4368cb9a7bf 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp @@ -677,6 +677,11 @@ NS_IMETHODIMP nsDeviceContextMac::GetDeviceContextFor(nsIDeviceContextSpec *aDev nsDeviceContextMac *macDC; aContext = new nsDeviceContextMac(); + if(nsnull == aContext){ + return NS_ERROR_OUT_OF_MEMORY; + } + NS_ADDREF(aContext); + macDC = (nsDeviceContextMac*)aContext; macDC->mSpec = aDevice; NS_ADDREF(aDevice);