diff options
author | weili <weili@chromium.org> | 2016-05-17 00:45:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-17 00:45:43 -0700 |
commit | 47b998b53edbb071bb55c909169be1070126fb22 (patch) | |
tree | 733e34fab09e6b4b488339adffd8d2245ed61e1a /core/fpdfapi/fpdf_edit | |
parent | 5f3b41bca725090391b9053a9435c86fa7b22df1 (diff) | |
download | pdfium-47b998b53edbb071bb55c909169be1070126fb22.tar.xz |
Remove an unnecessary variable from CPDF_Creator
The variable may not be initialized before using, which caused
errors on DrMemory bot. Since it is not necessary, remove it.
TBR=thestig@chromium.org
Review-Url: https://codereview.chromium.org/1988603002
Diffstat (limited to 'core/fpdfapi/fpdf_edit')
-rw-r--r-- | core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 10 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_edit/include/cpdf_creator.h | 1 |
2 files changed, 3 insertions, 8 deletions
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 372506d6cc..7604c62240 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -881,8 +881,10 @@ CPDF_Creator::CPDF_Creator(CPDF_Document* pDoc) m_bSecurityChanged(FALSE), m_pEncryptDict(m_pParser ? m_pParser->GetEncryptDict() : nullptr), m_dwEncryptObjNum(0), + m_bEncryptCloned(FALSE), m_pCryptoHandler(m_pParser ? m_pParser->GetCryptoHandler() : nullptr), m_pMetadata(nullptr), + m_pXRefStream(nullptr), m_ObjectStreamSize(200), m_dwLastObjNum(m_pDocument->GetLastObjNum()), m_Offset(0), @@ -1959,11 +1961,9 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) { CPDF_SecurityHandler handler; handler.OnCreate(m_pEncryptDict, m_pIDArray, user_pass.raw_str(), user_pass.GetLength(), flag); - if (m_bLocalCryptoHandler) - delete m_pCryptoHandler; + delete m_pCryptoHandler; m_pCryptoHandler = new CPDF_CryptoHandler; m_pCryptoHandler->Init(m_pEncryptDict, &handler); - m_bLocalCryptoHandler = TRUE; m_bSecurityChanged = TRUE; } } @@ -2008,10 +2008,6 @@ void CPDF_Creator::RemoveSecurity() { m_pCryptoHandler = nullptr; } void CPDF_Creator::ResetStandardSecurity() { - if (!m_bLocalCryptoHandler) - return; - delete m_pCryptoHandler; m_pCryptoHandler = nullptr; - m_bLocalCryptoHandler = FALSE; } diff --git a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h index c932dc0804..c63c864668 100644 --- a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h +++ b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h @@ -80,7 +80,6 @@ class CPDF_Creator { uint32_t m_dwEncryptObjNum; FX_BOOL m_bEncryptCloned; CPDF_CryptoHandler* m_pCryptoHandler; - FX_BOOL m_bLocalCryptoHandler; CPDF_Object* m_pMetadata; std::unique_ptr<CPDF_XRefStream> m_pXRefStream; int32_t m_ObjectStreamSize; |