summaryrefslogtreecommitdiff
path: root/core/include/fxcrt
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 22:22:13 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 22:22:13 -0700
commitda180e9fdd4385df024cc18046f62ca47bc74d74 (patch)
tree931e0e64ac2cbc82e3718e43418ee6bd676da4a5 /core/include/fxcrt
parent2b1a2d528469cda4e9f3e36d3c7a649e0d476480 (diff)
downloadpdfium-da180e9fdd4385df024cc18046f62ca47bc74d74.tar.xz
Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 . (cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b) Review URL: https://codereview.chromium.org/1287053005 .
Diffstat (limited to 'core/include/fxcrt')
-rw-r--r--core/include/fxcrt/fx_basic.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/core/include/fxcrt/fx_basic.h b/core/include/fxcrt/fx_basic.h
index 62a8f2a369..54c78eaf3d 100644
--- a/core/include/fxcrt/fx_basic.h
+++ b/core/include/fxcrt/fx_basic.h
@@ -627,9 +627,7 @@ class CFX_FixedBufGrow {
}
}
void SetDataSize(int data_size) {
- if (m_pData) {
- FX_Free(m_pData);
- }
+ FX_Free(m_pData);
m_pData = NULL;
if (data_size > FixedSize) {
m_pData = FX_Alloc(DataType, data_size);
@@ -637,11 +635,7 @@ class CFX_FixedBufGrow {
FXSYS_memset(m_Data, 0, sizeof(DataType) * FixedSize);
}
}
- ~CFX_FixedBufGrow() {
- if (m_pData) {
- FX_Free(m_pData);
- }
- }
+ ~CFX_FixedBufGrow() { FX_Free(m_pData); }
operator DataType*() { return m_pData ? m_pData : m_Data; }
private:
@@ -1214,9 +1208,7 @@ class CFX_SortListArray {
void Clear() {
for (int32_t i = m_DataLists.GetUpperBound(); i >= 0; i--) {
DataList list = m_DataLists.ElementAt(i);
- if (list.data) {
- FX_Free(list.data);
- }
+ FX_Free(list.data);
}
m_DataLists.RemoveAll();
m_CurList = 0;