Fixing error return type of OTMDoOwnershipTransfer API in case of NULL callback
authorsahil bansal <sahil.bansal@samsung.com>
Wed, 2 Mar 2016 04:58:15 +0000 (10:28 +0530)
committerRandeep Singh <randeep.s@samsung.com>
Wed, 2 Mar 2016 08:52:22 +0000 (08:52 +0000)
Change-Id: I832c4c8e5b2361cb122473b1cd9b0c0b8c24a8da
Signed-off-by: sahil bansal <sahil.bansal@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5287
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
Tested-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/provisioning/src/ownershiptransfermanager.c

index 210030c..ba284f6 100644 (file)
@@ -1274,10 +1274,14 @@ OCStackResult OTMDoOwnershipTransfer(void* ctx,
 {
     OIC_LOG(DEBUG, TAG, "IN OTMDoOwnershipTransfer");
 
-    if (NULL == selectedDevicelist || NULL == resultCallback )
+    if (NULL == selectedDevicelist)
     {
         return OC_STACK_INVALID_PARAM;
     }
+    if (NULL == resultCallback)
+    {
+        return OC_STACK_INVALID_CALLBACK;
+    }
 
     OTMContext_t* otmCtx = (OTMContext_t*)OICCalloc(1,sizeof(OTMContext_t));
     if(!otmCtx)