From 495bda110a6ea8e7a6fc313ec0232a9ca6e3cfdc Mon Sep 17 00:00:00 2001 From: thestig Date: Thu, 28 Apr 2016 17:29:19 -0700 Subject: Do not check pointers before deleting them. XFA edition. Review-Url: https://codereview.chromium.org/1925363002 --- xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'xfa/fxbarcode/common') diff --git a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp index 5e9fd33ac4..33771418d4 100644 --- a/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp +++ b/xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp @@ -31,16 +31,14 @@ void CBC_ReedSolomonGF256::Initialize() { DataMatrixField = new CBC_ReedSolomonGF256(0x012D); DataMatrixField->Init(); } + void CBC_ReedSolomonGF256::Finalize() { - if (QRCodeFild) { - delete QRCodeFild; - } - QRCodeFild = NULL; - if (DataMatrixField) { - delete DataMatrixField; - } - DataMatrixField = NULL; + delete QRCodeFild; + QRCodeFild = nullptr; + delete DataMatrixField; + DataMatrixField = nullptr; } + CBC_ReedSolomonGF256::CBC_ReedSolomonGF256(int32_t primitive) { int32_t x = 1; for (int32_t j = 0; j < 256; j++) { -- cgit v1.2.3