- 'addr' of CAEndpoint is a char array so the address of the array cannot
be null.
- 'requestData' is not dynamic-allocated memory.
Change-Id: Ibcb9f5011b01f19e4624b4d71dcb0181637480b3
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/19913
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
char* OCCreateEndpointStringFromCA(const CAEndpoint_t* endpoint)
{
- if (!endpoint)
+ if (!endpoint || 0 == strlen(endpoint->addr))
{
return NULL;
}
#ifdef HTTP_ADAPTER
case OC_HTTP: case OC_HTTPS:
#endif
- if (!endpoint->addr || !endpoint->port)
+ if (!endpoint->port)
{
goto exit;
}
break;
#ifdef EDR_ADAPTER
case OC_COAP_RFCOMM:
- if (!endpoint->addr)
- {
- goto exit;
- }
// coap+rfcomm
snprintf(buf, MAX_ADDR_STR_SIZE, "%s://%s", ConvertTpsToString(tps), endpoint->addr);
break;
}
#endif
return ret;
-}
\ No newline at end of file
+}
if (!requestData.options)
{
OIC_LOG(ERROR, TAG, "Out of memory");
- OICFree(&requestData.token);
+ OICFree(requestData.token);
goto proceed;
}
memcpy(requestData.options, cbNode->options,