From ba0779b4156306a91b8bd4f8e0c3cc7177c1869c Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Sat, 9 Apr 2016 13:18:10 +0200 Subject: [PATCH] Removed checks for NULL before calling delete or free --- UEFITool/uefitool.cpp | 20 +++++++------------- common/ffsparser.cpp | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/UEFITool/uefitool.cpp b/UEFITool/uefitool.cpp index ac178be..ce6b8df 100644 --- a/UEFITool/uefitool.cpp +++ b/UEFITool/uefitool.cpp @@ -130,17 +130,14 @@ void UEFITool::init() ui->actionMessagesCopyAll->setDisabled(true); // Create new model ... - if (model) - delete model; - model = new TreeModel(); + delete model; + model = new TreeModel(); ui->structureTreeView->setModel(model); // ... and ffsParser - if (ffsParser) - delete ffsParser; + delete ffsParser; ffsParser = new FfsParser(model); // ... and fitParser - if (fitParser) - delete fitParser; + delete fitParser; fitParser = new FitParser(model); // Connect @@ -678,8 +675,7 @@ void UEFITool::saveImageFile() QByteArray reconstructed; // Create ffsBuilder - if (!ffsBuilder) - delete ffsBuilder; + delete ffsBuilder; ffsBuilder = new FfsBuilder(model); STATUS result = ffsBuilder->build(model->index(0,0), reconstructed); showBuilderMessages(); @@ -759,13 +755,11 @@ void UEFITool::openImageFile(QString path) } // Enable search ... - if (ffsFinder) - delete ffsFinder; + delete ffsFinder; ffsFinder = new FfsFinder(model); ui->actionSearch->setEnabled(true); // ... and other operations - if (ffsOps) - delete ffsOps; + delete ffsOps; ffsOps = new FfsOperations(model); // Set current directory diff --git a/common/ffsparser.cpp b/common/ffsparser.cpp index 6ea8375..882067f 100644 --- a/common/ffsparser.cpp +++ b/common/ffsparser.cpp @@ -3943,7 +3943,7 @@ STATUS FfsParser::parseVssStoreBody(const QModelIndex & index) QString info; - // Rename deleted variables + // Rename invalid variables if (isInvalid) { name = QObject::tr("Invalid"); }