Fix cppcheck issues in resource-encapsulation dir
authorMarkus Jung <markus.jung@samsung.com>
Fri, 2 Oct 2015 02:09:06 +0000 (11:09 +0900)
committerMadan Lanka <lanka.madan@samsung.com>
Mon, 5 Oct 2015 11:21:40 +0000 (11:21 +0000)
This patch fixes the "(error) Returning reference to auto variable" issue reported
by cppcheck tool in resource-encapsulation/src/resourceContainer/src dir.

Change-Id: Idade3fb288f7571276274cccb30728cf46851ac6
Signed-off-by: Markus Jung <markus.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/3397
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
(cherry picked from commit 3a681a107a78bd3d36201bcd3cbfcb46500cc813)
Reviewed-on: https://gerrit.iotivity.org/gerrit/3473

service/resource-container/src/JavaBundleResource.cpp

index 47228ee..67e71b1 100644 (file)
@@ -147,13 +147,14 @@ void JavaBundleResource::handleSetAttributesRequest(RCSResourceAttributes &attrs
     }
 }
 
-RCSResourceAttributes & JavaBundleResource::handleGetAttributesRequest(){
-    RCSResourceAttributes ret;
+RCSResourceAttributes & JavaBundleResource::handleGetAttributesRequest()
+{
     std::list<string> attrsNames = getAttributeNames();
     for(std::list<string>::iterator iterator = attrsNames.begin();
-            iterator != attrsNames.end(); ++iterator ){
-        ret[*iterator] = handleGetAttributeRequest(*iterator);
+            iterator != attrsNames.end(); ++iterator )
+    {
+        handleGetAttributeRequest(*iterator);
     }
-    return ret;
+    return BundleResource::getAttributes();
 }
 #endif