From 1c8045756f66ee98523f0ce0c76238c14f2fce73 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 16 Aug 2016 12:23:12 +0200 Subject: [PATCH] Coverity issues: 129727: Structurally dead code 151979, 133461: Uninitialized scalar field 129785, 129786, 129787: Use after free --- src/App/Application.cpp | 4 ++-- src/App/ColorModel.cpp | 1 + src/App/Expression.cpp | 2 +- src/App/ObjectIdentifier.cpp | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 04a4cd981..297d9c4c0 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -1012,9 +1012,9 @@ void unexpection_error_handler() // try to throw an exception and give the user chance to save their work #if !defined(_DEBUG) throw Base::Exception("Unexpected error occurred! Please save your work under a new file name and restart the application!"); -#endif - +#else terminate(); +#endif } #ifdef _MSC_VER // Microsoft compiler diff --git a/src/App/ColorModel.cpp b/src/App/ColorModel.cpp index eb0105976..a668d9ba6 100644 --- a/src/App/ColorModel.cpp +++ b/src/App/ColorModel.cpp @@ -56,6 +56,7 @@ ColorModel& ColorModel::operator = (const ColorModel &rclM) return *this; delete [] _pclColors; + _pclColors = 0; _usColors = rclM._usColors; if (_usColors == 0) diff --git a/src/App/Expression.cpp b/src/App/Expression.cpp index f73727123..6f4087bc9 100644 --- a/src/App/Expression.cpp +++ b/src/App/Expression.cpp @@ -773,7 +773,7 @@ private: class StdDevCollector : public Collector { public: - StdDevCollector() : Collector() { } + StdDevCollector() : Collector(), n(0) { } void collect(Quantity value) { Collector::collect(value); diff --git a/src/App/ObjectIdentifier.cpp b/src/App/ObjectIdentifier.cpp index 0b089176b..635fc1980 100644 --- a/src/App/ObjectIdentifier.cpp +++ b/src/App/ObjectIdentifier.cpp @@ -470,6 +470,7 @@ ObjectIdentifier::Component::Component(const String &_component, ObjectIdentifie , type(_type) , index(_index) , key(_key) + , keyIsString(false) { }