From: Erich Keane Date: Mon, 2 Mar 2015 21:04:47 +0000 (-0800) Subject: Fixed Klocwork errors in InProcClientWrapper.cpp X-Git-Tag: 1.2.0+RC1~1855^2~124 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a20341653ddea0dc3235a0c5d27e58a5ba38f497;p=platform%2Fupstream%2Fiotivity.git Fixed Klocwork errors in InProcClientWrapper.cpp Klocworks identified a number of issues as memory leaks, so this fix updates the calls to use the newer version of OCDoResource which permits passing of a NULL rather than using the out parameter. Change-Id: I02cf1d83d4dfafca0773e6e3385881d180335de4 Signed-off-by: Erich Keane Reviewed-on: https://gerrit.iotivity.org/gerrit/428 Tested-by: jenkins-iotivity Reviewed-by: Sakthivel Samidurai Reviewed-by: Sashi Penta --- diff --git a/resource/src/InProcClientWrapper.cpp b/resource/src/InProcClientWrapper.cpp index 0fd1176..2eb81fb 100644 --- a/resource/src/InProcClientWrapper.cpp +++ b/resource/src/InProcClientWrapper.cpp @@ -209,8 +209,7 @@ namespace OC if(cLock) { std::lock_guard lock(*cLock); - OCDoHandle handle; - result = OCDoResource(&handle, OC_REST_GET, + result = OCDoResource(nullptr, OC_REST_GET, resourceType.c_str(), nullptr, nullptr, connectivityType, static_cast(QoS), @@ -355,12 +354,11 @@ namespace OC os << host << assembleSetResourceUri(uri, queryParams).c_str(); std::lock_guard lock(*cLock); - OCDoHandle handle; OCHeaderOption options[MAX_HEADER_OPTIONS]; assembleHeaderOptions(options, headerOptions); - result = OCDoResource(&handle, OC_REST_GET, os.str().c_str(), + result = OCDoResource(nullptr, OC_REST_GET, os.str().c_str(), nullptr, nullptr, connectivityType, static_cast(QoS), &cbdata, @@ -465,10 +463,9 @@ namespace OC { std::lock_guard lock(*cLock); OCHeaderOption options[MAX_HEADER_OPTIONS]; - OCDoHandle handle; assembleHeaderOptions(options, headerOptions); - result = OCDoResource(&handle, OC_REST_POST, + result = OCDoResource(nullptr, OC_REST_POST, os.str().c_str(), nullptr, assembleSetResourcePayload(rep).c_str(), connectivityType, static_cast(QoS),