Fixing Klocwork reported error in secure sample apps
authorSachin Agrawal <sachin.agrawal@intel.com>
Fri, 27 Feb 2015 19:49:26 +0000 (11:49 -0800)
committerSudarshan Prasad <sudarshan.prasad@intel.com>
Mon, 2 Mar 2015 03:56:41 +0000 (03:56 +0000)
Recently OCDoResource API was updated to take a NULL handle.
Updated sample apps to pass a NULL handle. This will stop
Klocwork on generating false positives.

Change-Id: I35f81cdde155a4118578ea86a35a981038c22f2e
Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/421
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
Reviewed-by: Sakthivel Samidurai <sakthivel.samidurai@intel.com>
Reviewed-by: Sudarshan Prasad <sudarshan.prasad@intel.com>
resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp

index e612072..7b7333b 100644 (file)
@@ -80,13 +80,12 @@ OCStackResult InvokeOCDoResource(std::ostringstream &query,
 {
     OCStackResult ret;
     OCCallbackData cbData;
-    OCDoHandle handle;
 
     cbData.cb = cb;
     cbData.context = NULL;
     cbData.cd = NULL;
 
-    ret = OCDoResource(&handle, method, query.str().c_str(), 0,
+    ret = OCDoResource(NULL, method, query.str().c_str(), 0,
             (method == OC_REST_PUT || method == OC_REST_POST) ? putPayload.c_str() : NULL,
             ocConnType, qos, &cbData, options, numOptions);
 
@@ -240,7 +239,6 @@ int InitDiscovery()
 {
     OCStackResult ret;
     OCCallbackData cbData;
-    OCDoHandle handle;
     char szQueryUri[MAX_URI_LENGTH] = { 0 };
     OCConnectivityType discoveryReqConnType;
 
@@ -279,7 +277,7 @@ int InitDiscovery()
         (UNICAST_DISCOVERY) ? "Unicast" : "Multicast",
         szQueryUri);
 
-    ret = OCDoResource(&handle, OC_REST_GET, szQueryUri, 0, 0,
+    ret = OCDoResource(NULL, OC_REST_GET, szQueryUri, 0, 0,
             discoveryReqConnType, OC_LOW_QOS, &cbData, NULL, 0);
     if (ret != OC_STACK_OK)
     {