fix cloud unitialized pointer dereference 23/24523/1
authorMats Wichmann <mats@linux.com>
Thu, 29 Mar 2018 18:45:20 +0000 (12:45 -0600)
committerMats Wichmann <mats@linux.com>
Thu, 29 Mar 2018 18:45:20 +0000 (12:45 -0600)
Change-Id: I869aa695160203ebb1d0cb0701c3d43f55278c41
Signed-off-by: Mats Wichmann <mats@linux.com>
resource/csdk/security/provisioning/src/cloud/cloudresource.c

index 61c5963..9f2c60a 100644 (file)
@@ -390,8 +390,8 @@ static OCEntityHandlerResult HandleCloudDeleteRequest(OCEntityHandlerRequest *eh
 exit:
     response.requestHandle = ehRequest->requestHandle;
     response.ehResult = ehRet;
-    response.payload->type = PAYLOAD_TYPE_REPRESENTATION;
     response.payload = (OCPayload *)OCRepPayloadCreate();
+    response.payload->type = PAYLOAD_TYPE_REPRESENTATION;
     response.persistentBufferFlag = 0;
 
     if (OC_STACK_OK != OCDoResponse(&response))