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/oned/BC_OneDimWriter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xfa/fxbarcode/oned') diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp index b95c2be283..ae1b237957 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp @@ -290,6 +290,7 @@ void CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents, } FX_Free(pCharPos); } + void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, const CFX_WideStringC& contents, int32_t& e) { @@ -319,11 +320,10 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap, BC_EXCEPTION_CHECK_ReturnVoid(e); } CFX_DIBitmap* pStretchBitmap = pOutBitmap->StretchTo(m_Width, m_Height); - if (pOutBitmap) { - delete pOutBitmap; - } + delete pOutBitmap; pOutBitmap = pStretchBitmap; } + void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix, const CFX_WideStringC& contents, -- cgit v1.2.3