diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-14 15:45:39 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-14 15:45:39 -0700 |
commit | cb62e7657b3a9a04142028a4e6614029a08e894b (patch) | |
tree | e7fa5f4c7d7f12bff9315475a89872fb044c36b1 /core/src/fpdfapi/fpdf_edit | |
parent | 0f6b51c0fdd14f5762bf3c7412ac59c825443cc3 (diff) | |
download | pdfium-cb62e7657b3a9a04142028a4e6614029a08e894b.tar.xz |
Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1297713003 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 6 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp | 10 |
2 files changed, 5 insertions, 11 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index ff0539c61f..668c70b243 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -403,7 +403,7 @@ CPDF_FlateEncoder::~CPDF_FlateEncoder() { if (m_bCloned && m_pDict) { m_pDict->Release(); } - if (m_bNewData && m_pData) { + if (m_bNewData) { FX_Free(m_pData); } } @@ -2054,9 +2054,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) { CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD)); m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument); } - if (pBuffer) { - FX_Free(pBuffer); - } + FX_Free(pBuffer); } if (!bDefault) { return; diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp index 9ea94bdd00..488d8393c7 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp @@ -278,10 +278,8 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, pDict->Release(); pDict = NULL; } - if (dest_buf) { - FX_Free(dest_buf); - dest_buf = NULL; - } + FX_Free(dest_buf); + dest_buf = NULL; dest_size = 0; delete pNewBitmap; return; @@ -380,9 +378,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap, m_bIsMask = pBitmap->IsAlphaMask(); m_Width = BitmapWidth; m_Height = BitmapHeight; - if (dest_buf) { - FX_Free(dest_buf); - } + FX_Free(dest_buf); } void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap) { pPage->GetRenderCache()->ResetBitmap(m_pStream, pBitmap); |