From 1bcb167b15a273a8f0ea14d0f2fe3b79e3a12814 Mon Sep 17 00:00:00 2001 From: Sachin Agrawal Date: Fri, 27 Feb 2015 11:49:26 -0800 Subject: [PATCH] Fixing Klocwork reported error in secure sample apps 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/421 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane Reviewed-by: Sakthivel Samidurai Reviewed-by: Sudarshan Prasad --- resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp b/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp index e612072..7b7333b 100644 --- a/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp +++ b/resource/csdk/stack/samples/linux/secure/occlientbasicops.cpp @@ -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) { -- 2.7.4