char* iterToken, *iterTokenPtr;
iterToken = (char *) strtok_r(pRequest, ":", &iterTokenPtr);
+ VARIFY_POINTER_NULL(iterToken, result, exit);
length = strlen(iterToken) + 1;
*key = (char *) OCMalloc(length);
((*key)[((length - 1) - 2)]) = '\0';
iterToken = (char *) strtok_r(NULL, "}", &iterTokenPtr);
+ VARIFY_POINTER_NULL(iterToken, result, exit);
length = strlen(iterToken) + 1;
*value = (char *) OCMalloc(length);
{
char temp[1024] = { 0 };
int remaining = 1023;
+ OCStackResult res = OC_STACK_ERROR;
OCAction *action = actionset->head;
}
else
{
- return OC_STACK_ERROR;
+ res = OC_STACK_ERROR;
+ goto exit;
}
while (action != NULL)
}
*desc = (char *) OCMalloc(1024 - remaining);
+ VARIFY_POINTER_NULL(*desc, res, exit);
strcpy(*desc, temp);
return OC_STACK_OK;
+
+exit:
+ OCFREE(*desc);
+ return res;
+
}
OCStackApplicationResult ActionSetCB(void* context, OCDoHandle handle,
(unsigned int) (strlen((char *) clientResponse->resJSONPayload)
+ 1));
+ if( responseJson == NULL )
+ return OC_STACK_DELETE_TRANSACTION;
+
// We need the body of response.
// Copy the body from the response
strcpy((char *) responseJson,
ClientRequestInfo *info = (ClientRequestInfo *) OCMalloc(
sizeof(ClientRequestInfo));
+
+ if( info == NULL )
+ return OC_STACK_NO_MEMORY;
+
memset(info, 0, sizeof(ClientRequestInfo));
info->collResource = resource;