things-manager: Fix cppcheck errors
authorRavi Nanjundappa <nravi.n@samsung.com>
Wed, 1 Jul 2015 09:02:58 +0000 (14:32 +0530)
committerUze Choi <uzchoi@samsung.com>
Mon, 6 Jul 2015 02:44:16 +0000 (02:44 +0000)
This patch fixes the errors reported by cppcheck tool for '(error) Mismatching
allocation and deallocation: newActionSet'.
Replaced free() calls with delete wherever the memory is allocated using new().

Change-Id: Icc22a8c7658c29afb8ed60b5cd9926e69ce3e6fb
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1506
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/things-manager/sdk/src/ThingsConfiguration.cpp
service/things-manager/sdk/src/ThingsDiagnostics.cpp

index f390565..9c68645 100755 (executable)
@@ -285,7 +285,7 @@ namespace OIC
                                     std::placeholders::_1, std::placeholders::_2,
                                     std::placeholders::_3, conf)));
 
-            free(newActionSet);
+            delete(newActionSet);
         }
     }
 
index 03ca932..5c65f21 100644 (file)
@@ -257,7 +257,7 @@ namespace OIC
                                     std::placeholders::_1, std::placeholders::_2,
                                     std::placeholders::_3, diag)));
 
-            free(newActionSet);
+            delete(newActionSet);
 
         }
     }