Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1072)

Unified Diff: xfa/fxbarcode/pdf417/BC_PDF417Detector.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp ('k') | xfa/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/pdf417/BC_PDF417Detector.cpp
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417Detector.cpp b/xfa/fxbarcode/pdf417/BC_PDF417Detector.cpp
index cfd52e56dc5c38929921651e11fc3e3e2eece46c..345efd564842f56ca31607ef17bf975ada87716c 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417Detector.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417Detector.cpp
@@ -114,9 +114,7 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple,
CFX_PtrArray* vertices = findVertices(bitMatrix, row, column);
if (vertices->GetAt(0) == NULL && vertices->GetAt(3) == NULL) {
if (!foundBarcodeInRow) {
- if (vertices) {
- delete (vertices);
- }
+ delete vertices;
break;
}
foundBarcodeInRow = FALSE;
@@ -132,9 +130,7 @@ CFX_PtrArray* CBC_Detector::detect(FX_BOOL multiple,
}
}
row += ROW_STEP;
- if (vertices) {
- delete (vertices);
- }
+ delete vertices;
continue;
}
foundBarcodeInRow = TRUE;
« no previous file with comments | « xfa/fxbarcode/pdf417/BC_PDF417BoundingBox.cpp ('k') | xfa/fxbarcode/pdf417/BC_PDF417ECErrorCorrection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698