Revert "Remove FX_Alloc() null checks now that it can't return NULL."
[pdfium.git] / core / src / fxcrt / fx_basic_wstring.cpp
index 09e64e0..3c54ca9 100644 (file)
@@ -34,6 +34,9 @@ CFX_WideString::StringData* CFX_WideString::StringData::Create(int nLen)
     FXSYS_assert(usableLen >= nLen);
 
     void* pData = FX_Alloc(FX_BYTE, iSize.ValueOrDie());
+    if (!pData) {
+        return NULL;
+    }
     return new (pData) StringData(nLen, usableLen);
 }
 CFX_WideString::~CFX_WideString()