[Digikam-devel] New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Wed Nov 18 02:00:56 GMT 2015
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.
6 new defect(s) introduced to digiKam found with Coverity Scan.
5 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 6 of 6 defect(s)
** CID 1339824: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/facesengine/moc_facedbbackend.cpp: 85 in FacesEngine::FaceDbBackend::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1339824: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/facesengine/moc_facedbbackend.cpp: 85 in FacesEngine::FaceDbBackend::qt_metacall(QMetaObject::Call, int, void **)()
79 return BdEngineBackend::qt_metacast(_clname);
80 }
81
82 int FacesEngine::FaceDbBackend::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = BdEngineBackend::qt_metacall(_c, _id, _a);
>>> CID 1339824: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1339823: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/database/moc_thumbsdbbackend.cpp: 85 in Digikam::ThumbsDbBackend::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1339823: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/database/moc_thumbsdbbackend.cpp: 85 in Digikam::ThumbsDbBackend::qt_metacall(QMetaObject::Call, int, void **)()
79 return BdEngineBackend::qt_metacast(_clname);
80 }
81
82 int Digikam::ThumbsDbBackend::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = BdEngineBackend::qt_metacall(_c, _id, _a);
>>> CID 1339823: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1339822: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/database/moc_dbenginebackend.cpp: 85 in Digikam::BdEngineBackend::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1339822: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/database/moc_dbenginebackend.cpp: 85 in Digikam::BdEngineBackend::qt_metacall(QMetaObject::Call, int, void **)()
79 return QObject::qt_metacast(_clname);
80 }
81
82 int Digikam::BdEngineBackend::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = QObject::qt_metacall(_c, _id, _a);
>>> CID 1339822: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1339821: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/database/moc_coredbbackend.cpp: 85 in Digikam::CoreDbBackend::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1339821: Incorrect expression (IDENTICAL_BRANCHES)
/core/libs/database/moc_coredbbackend.cpp: 85 in Digikam::CoreDbBackend::qt_metacall(QMetaObject::Call, int, void **)()
79 return BdEngineBackend::qt_metacast(_clname);
80 }
81
82 int Digikam::CoreDbBackend::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = BdEngineBackend::qt_metacall(_c, _id, _a);
>>> CID 1339821: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1339820: Resource leaks (CTOR_DTOR_LEAK)
/home/gilles/Devel/5.x/core/libs/facesengine/recognitiondatabase.cpp: 216 in FacesEngine::RecognitionDatabase::RecognitionDatabase()()
________________________________________________________________________________________________________
*** CID 1339820: Resource leaks (CTOR_DTOR_LEAK)
/home/gilles/Devel/5.x/core/libs/facesengine/recognitiondatabase.cpp: 216 in FacesEngine::RecognitionDatabase::RecognitionDatabase()()
210
211 // other RecognitionDatabase::Private methods are to be found below, in the relevant context of the main class
212
213 // -------------------------------------------------------------------------------------------------
214
215 RecognitionDatabase::RecognitionDatabase()
>>> CID 1339820: Resource leaks (CTOR_DTOR_LEAK)
>>> The constructor allocates field "d" of "FacesEngine::RecognitionDatabase" but the destructor and whatever functions it calls do not free it.
216 : d(new Private)
217 {
218 }
219
220 RecognitionDatabase::~RecognitionDatabase()
221 {
** CID 1339819: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/libs/database/coredb/coredbchecker.cpp: 86 in Digikam::CoreDbPrivilegesChecker::checkPrivileges(QStringList &)()
________________________________________________________________________________________________________
*** CID 1339819: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/libs/database/coredb/coredbchecker.cpp: 86 in Digikam::CoreDbPrivilegesChecker::checkPrivileges(QStringList &)()
80 {
81 insufficientRights.append(QLatin1String("DROP TABLE"));
82 result = false;
83 }
84
85 // Try to delete this table in any case
>>> CID 1339819: Error handling issues (CHECKED_RETURN)
>>> Calling "checkPriv" without checking return value (as is done elsewhere 5 out of 6 times).
86 checkPriv(fromDBbackend, QLatin1String("CheckPriv_Cleanup"));
87
88 return result;
89 }
90
91 bool CoreDbPrivilegesChecker::checkPriv(CoreDbBackend& dbBackend, const QString& dbActionName)
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/digikam?tab=overview
To manage Coverity Scan email notifications for "digikam-devel at kde.org", click https://scan.coverity.com/subscriptions/edit?email=digikam-devel%40kde.org&token=621bfe7450f4a870432a2a9c106aa3a8
More information about the Digikam-devel
mailing list