[Kde-imaging] New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Sat Mar 23 20:14:31 UTC 2013
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity SCAN
Defect(s) Reported-by: Coverity Scan
** CID 993180: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 138
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=993180
** CID 993179: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 116
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=993179
** CID 993178: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 107
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=993178
** CID 993177: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/core/utilities/facemanagement/facepipeline.cpp: 1059
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=993177
** CID 989146: Uninitialized scalar field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.cpp: 43
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=989146
________________________________________________________________________
CID 993180: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 53 ( alloc_fn)
50 tagged.append(singlephototagged);
51 }
52
>>> Storage is returned from allocation function "operator new(std::size_t)".
53 Tlddatabase *tlddatabase = new Tlddatabase;
54
55 for (int i = 1; i <= tlddatabase->queryNumfacesinDatabase();i++ )//first grouping based on data present in database
56 {
57 int numfacesingroup = -1;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 53 ( var_assign)
50 tagged.append(singlephototagged);
51 }
52
>>> Assigning: "tlddatabase" = storage returned from "new KFaceIface::Tlddatabase".
53 Tlddatabase *tlddatabase = new Tlddatabase;
54
55 for (int i = 1; i <= tlddatabase->queryNumfacesinDatabase();i++ )//first grouping based on data present in database
56 {
57 int numfacesingroup = -1;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 55 ( noescape)
52
53 Tlddatabase *tlddatabase = new Tlddatabase;
54
>>> Resource "tlddatabase" is not freed or pointed-to in function "KFaceIface::Tlddatabase::queryNumfacesinDatabase() const".
55 for (int i = 1; i <= tlddatabase->queryNumfacesinDatabase();i++ )//first grouping based on data present in database
56 {
57 int numfacesingroup = -1;
58 unitFaceModel* const comparemodel = tlddatabase->getFaceModel(i);
59 QList<IplImage*> recognisedGroup;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 58 ( noescape)
55 for (int i = 1; i <= tlddatabase->queryNumfacesinDatabase();i++ )//first grouping based on data present in database
56 {
57 int numfacesingroup = -1;
>>> Resource "tlddatabase" is not freed or pointed-to in function "KFaceIface::Tlddatabase::getFaceModel(int) const".
58 unitFaceModel* const comparemodel = tlddatabase->getFaceModel(i);
59 QList<IplImage*> recognisedGroup;
60 for(int j=0;j< inputFaceList.size();j++)
61 {
62 for (int k=0;k<inputFaceList.at(j).size();k++)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 78 ( noescape)
75 if(numfacesingroup >= 0)
76 {
77 allGrouped.append(recognisedGroup);
>>> Resource "tlddatabase" is not freed or pointed-to in function "KFaceIface::Tlddatabase::querybyFaceid(int) const".
78 groupnames.append(tlddatabase->querybyFaceid(i));
79 }
80 }
81
82 for(int i=0;i<inputFaceList.size()-1;i++)//group similar faces and not recognised from database
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 55 ( noescape)
52
53 Tlddatabase *tlddatabase = new Tlddatabase;
54
>>> Resource "tlddatabase" is not freed or pointed-to in function "KFaceIface::Tlddatabase::queryNumfacesinDatabase() const".
55 for (int i = 1; i <= tlddatabase->queryNumfacesinDatabase();i++ )//first grouping based on data present in database
56 {
57 int numfacesingroup = -1;
58 unitFaceModel* const comparemodel = tlddatabase->getFaceModel(i);
59 QList<IplImage*> recognisedGroup;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 58 ( noescape)
55 for (int i = 1; i <= tlddatabase->queryNumfacesinDatabase();i++ )//first grouping based on data present in database
56 {
57 int numfacesingroup = -1;
>>> Resource "tlddatabase" is not freed or pointed-to in function "KFaceIface::Tlddatabase::getFaceModel(int) const".
58 unitFaceModel* const comparemodel = tlddatabase->getFaceModel(i);
59 QList<IplImage*> recognisedGroup;
60 for(int j=0;j< inputFaceList.size();j++)
61 {
62 for (int k=0;k<inputFaceList.at(j).size();k++)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 78 ( noescape)
75 if(numfacesingroup >= 0)
76 {
77 allGrouped.append(recognisedGroup);
>>> Resource "tlddatabase" is not freed or pointed-to in function "KFaceIface::Tlddatabase::querybyFaceid(int) const".
78 groupnames.append(tlddatabase->querybyFaceid(i));
79 }
80 }
81
82 for(int i=0;i<inputFaceList.size()-1;i++)//group similar faces and not recognised from database
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 55 ( noescape)
52
53 Tlddatabase *tlddatabase = new Tlddatabase;
54
>>> Resource "tlddatabase" is not freed or pointed-to in function "KFaceIface::Tlddatabase::queryNumfacesinDatabase() const".
55 for (int i = 1; i <= tlddatabase->queryNumfacesinDatabase();i++ )//first grouping based on data present in database
56 {
57 int numfacesingroup = -1;
58 unitFaceModel* const comparemodel = tlddatabase->getFaceModel(i);
59 QList<IplImage*> recognisedGroup;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 138 ( leaked_storage)
135 }
136 groupnames.append("unknown");
137 allGrouped.append(tmpgroup);
>>> CID 993180: Resource leak (RESOURCE_LEAK)
>>> Variable "tlddatabase" going out of scope leaks the storage it points to.
138 }
139
140 } // namespace KFaceIface
________________________________________________________________________
CID 993179: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 89 ( alloc_fn)
86 if(tagged.at(i).at(j) == false)
87 {
88 Tldrecognition* const tmpTLD = new Tldrecognition;
>>> Storage is returned from allocation function "KFaceIface::Tldrecognition::getModeltoStore(IplImage *) const".
89 unitFaceModel *comparemodel = tmpTLD->getModeltoStore(resizedinputFaceList.at(i).at(j));
90 delete tmpTLD;
91 QList<IplImage*> tmpGroup;
92 tmpGroup.append(resizedinputFaceList.at(i).at(j));
93 int tmpfacecount = 0;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 89 ( var_assign)
86 if(tagged.at(i).at(j) == false)
87 {
88 Tldrecognition* const tmpTLD = new Tldrecognition;
>>> Assigning: "comparemodel" = storage returned from "tmpTLD->getModeltoStore(this->resizedinputFaceList.at(i)->at(j))".
89 unitFaceModel *comparemodel = tmpTLD->getModeltoStore(resizedinputFaceList.at(i).at(j));
90 delete tmpTLD;
91 QList<IplImage*> tmpGroup;
92 tmpGroup.append(resizedinputFaceList.at(i).at(j));
93 int tmpfacecount = 0;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 101 ( noescape)
98 if(tagged.at(m).at(n) == false)
99 {
100 Tldrecognition* const tmpTLD = new Tldrecognition;
>>> Resource "comparemodel" is not freed or pointed-to in function "KFaceIface::Tldrecognition::getRecognitionConfidence(IplImage *, KFaceIface::unitFaceModel *) const".
101 if(tmpTLD->getRecognitionConfidence(resizedinputFaceList.at(m).at(n),comparemodel) > 0.6)
102 {
103 tmpGroup.append(resizedinputFaceList.at(m).at(n));
104 tagged[i].replace(j,true);
105 tmpfacecount++;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 116 ( leaked_storage)
113 allGrouped.append(tmpGroup);//create new group if more than one among nottagged faces found similar
114 modelsToStore.append(comparemodel);//model to store in database later on based on new name to group choosen by user
115 }
>>> CID 993179: Resource leak (RESOURCE_LEAK)
>>> Variable "comparemodel" going out of scope leaks the storage it points to.
116 }
117 }
118 }
119
120 QList<IplImage *> tmpgroup;
________________________________________________________________________
CID 993178: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 100 ( alloc_fn)
97 {
98 if(tagged.at(m).at(n) == false)
99 {
>>> Storage is returned from allocation function "operator new(std::size_t)".
100 Tldrecognition* const tmpTLD = new Tldrecognition;
101 if(tmpTLD->getRecognitionConfidence(resizedinputFaceList.at(m).at(n),comparemodel) > 0.6)
102 {
103 tmpGroup.append(resizedinputFaceList.at(m).at(n));
104 tagged[i].replace(j,true);
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 100 ( var_assign)
97 {
98 if(tagged.at(m).at(n) == false)
99 {
>>> Assigning: "tmpTLD" = storage returned from "new KFaceIface::Tldrecognition".
100 Tldrecognition* const tmpTLD = new Tldrecognition;
101 if(tmpTLD->getRecognitionConfidence(resizedinputFaceList.at(m).at(n),comparemodel) > 0.6)
102 {
103 tmpGroup.append(resizedinputFaceList.at(m).at(n));
104 tagged[i].replace(j,true);
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 101 ( noescape)
98 if(tagged.at(m).at(n) == false)
99 {
100 Tldrecognition* const tmpTLD = new Tldrecognition;
>>> Resource "tmpTLD" is not freed or pointed-to in function "KFaceIface::Tldrecognition::getRecognitionConfidence(IplImage *, KFaceIface::unitFaceModel *) const".
101 if(tmpTLD->getRecognitionConfidence(resizedinputFaceList.at(m).at(n),comparemodel) > 0.6)
102 {
103 tmpGroup.append(resizedinputFaceList.at(m).at(n));
104 tagged[i].replace(j,true);
105 tmpfacecount++;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldclassify.cpp: 107 ( leaked_storage)
104 tagged[i].replace(j,true);
105 tmpfacecount++;
106 }
>>> CID 993178: Resource leak (RESOURCE_LEAK)
>>> Variable "tmpTLD" going out of scope leaks the storage it points to.
107 }
108 }
109 }
110 if(tmpfacecount > 0)
111 {
________________________________________________________________________
CID 993177: Resource leak (RESOURCE_LEAK)
/mnt/devel/GIT/3.x/core/utilities/facemanagement/facepipeline.cpp: 1048 ( alloc_fn)
1045
1046 KFaceIface::Tlddatabase* const tlddatabase = new KFaceIface::Tlddatabase();
1047 KFaceIface::Tldrecognition* const tmpTLD = new KFaceIface::Tldrecognition;
>>> Storage is returned from allocation function "KFaceIface::Tldrecognition::getModeltoStore(IplImage *) const".
1048 KFaceIface::unitFaceModel* const facemodeltostore = tmpTLD->getModeltoStore(inputfaceimage);
1049 facemodeltostore->Name = package->faces[assignedNameindex].name();
1050
1051 kDebug() << "person " << qPrintable(package->faces.at(assignedNameindex).name())
1052 << " stored in recognition database";
/mnt/devel/GIT/3.x/core/utilities/facemanagement/facepipeline.cpp: 1048 ( var_assign)
1045
1046 KFaceIface::Tlddatabase* const tlddatabase = new KFaceIface::Tlddatabase();
1047 KFaceIface::Tldrecognition* const tmpTLD = new KFaceIface::Tldrecognition;
>>> Assigning: "facemodeltostore" = storage returned from "tmpTLD->getModeltoStore(inputfaceimage)".
1048 KFaceIface::unitFaceModel* const facemodeltostore = tmpTLD->getModeltoStore(inputfaceimage);
1049 facemodeltostore->Name = package->faces[assignedNameindex].name();
1050
1051 kDebug() << "person " << qPrintable(package->faces.at(assignedNameindex).name())
1052 << " stored in recognition database";
/mnt/devel/GIT/3.x/core/utilities/facemanagement/facepipeline.cpp: 1054 ( noescape)
1051 kDebug() << "person " << qPrintable(package->faces.at(assignedNameindex).name())
1052 << " stored in recognition database";
1053
>>> Resource "facemodeltostore" is not freed or pointed-to in function "KFaceIface::Tlddatabase::insertFaceModel(KFaceIface::unitFaceModel *) const".
1054 tlddatabase->insertFaceModel(facemodeltostore); //store facemodel in tlddatabase
1055
1056 delete tmpTLD;
1057 delete tlddatabase;
1058 assignedNameindex++;
/mnt/devel/GIT/3.x/core/utilities/facemanagement/facepipeline.cpp: 1059 ( leaked_storage)
1056 delete tmpTLD;
1057 delete tlddatabase;
1058 assignedNameindex++;
>>> CID 993177: Resource leak (RESOURCE_LEAK)
>>> Variable "facemodeltostore" going out of scope leaks the storage it points to.
1059 }
1060 }
1061
1062 iface.removeFaces(toTrain);
1063 package->databaseFaces.replaceRole(FacePipelineDatabaseFace::ForTraining, FacePipelineDatabaseFace::Trained);
________________________________________________________________________
CID 989146: Uninitialized scalar field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.h: 78 ( member_decl)
75 QString serialisedLeaves;
76 QString Name;
77
>>> Class member declaration for "faceid".
78 int faceid;
79 int objHeight;
80 int objWidth;
81
82 float minVar;
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.cpp: 43 ( uninit_member)
40
41 unitFaceModel::unitFaceModel()
42 {
>>> Non-static class member "faceid" is not initialized in this constructor nor in any functions that it calls.
43 }
44
45 unitFaceModel::~unitFaceModel()
46 {
47 }
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.h: 79 ( member_decl)
76 QString Name;
77
78 int faceid;
>>> Class member declaration for "objHeight".
79 int objHeight;
80 int objWidth;
81
82 float minVar;
83 };
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.cpp: 43 ( uninit_member)
40
41 unitFaceModel::unitFaceModel()
42 {
>>> Non-static class member "objHeight" is not initialized in this constructor nor in any functions that it calls.
43 }
44
45 unitFaceModel::~unitFaceModel()
46 {
47 }
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.h: 80 ( member_decl)
77
78 int faceid;
79 int objHeight;
>>> Class member declaration for "objWidth".
80 int objWidth;
81
82 float minVar;
83 };
84
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.cpp: 43 ( uninit_member)
40
41 unitFaceModel::unitFaceModel()
42 {
>>> Non-static class member "objWidth" is not initialized in this constructor nor in any functions that it calls.
43 }
44
45 unitFaceModel::~unitFaceModel()
46 {
47 }
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.h: 82 ( member_decl)
79 int objHeight;
80 int objWidth;
81
>>> Class member declaration for "minVar".
82 float minVar;
83 };
84
85 } // namespace KFaceIface
86
/mnt/devel/GIT/3.x/extra/libkface/libkface/tldface.cpp: 43 ( uninit_member)
40
41 unitFaceModel::unitFaceModel()
42 {
>>> CID 989146: Uninitialized scalar field (UNINIT_CTOR)
>>> Non-static class member "minVar" is not initialized in this constructor nor in any functions that it calls.
43 }
44
45 unitFaceModel::~unitFaceModel()
46 {
47 }
________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan5.coverity.com:8080
If you don't have a username, you can request one by emailing: scan-admin at coverity.com
To unsubscribe from the email notification for new defects, http://scan.coverity.com/email_unsubscribe.html
If you are project owner, you can subscribe your team member by accessing http://scan.coverity.com/email_subscription.html
More information about the Kde-imaging
mailing list