SEPARATOR_LENGTH + strlen(attributeType) +
SEPARATOR_LENGTH + strlen(newValue) + 1;
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
}
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_WRITEATTR);
if (twRet != TW_RESULT_OK)
{
ret = OC_STACK_OK;
exit:
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave TWSetAttribute() with ret=%d", ret);
return ret;
SEPARATOR_LENGTH + strlen(clusterId) +
SEPARATOR_LENGTH + strlen(attributeId) + 1;
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
}
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_RESPATTR);
if (twRet != TW_RESULT_OK)
{
ret = OC_STACK_OK;
exit:
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave TWGetAttribute() with ret=%d", ret);
return ret;
SEPARATOR_LENGTH + strlen(newState) + 1;
}
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
}
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
if (twRet != TW_RESULT_OK)
{
ret = OC_STACK_OK;
exit:
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave TWSwitchOnOff() with ret=%d", ret);
return ret;
SEPARATOR_LENGTH + strlen(level) +
SEPARATOR_LENGTH + strlen(transTime) + 1;
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
if (twRet != TW_RESULT_OK)
{
ret = OC_STACK_OK;
exit:
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave TWMoveToLevel() with ret=%d", ret);
return ret;
SEPARATOR_LENGTH + strlen(SENDMODE) +
SEPARATOR_LENGTH + strlen(newState) + 1;
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
if (twRet != TW_RESULT_OK)
{
ret = OC_STACK_OK;
exit:
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave TWSwitchDoorLockState() with ret=%d", ret);
return ret;
SEPARATOR_LENGTH + strlen(colorTemperature) +
SEPARATOR_LENGTH + strlen(transTime) + 1;
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
}
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
twRet = TWDequeueEntry(ctx->g_plugin, &entry, TW_DFTREP);
if (twRet != TW_RESULT_OK)
{
ret = OC_STACK_OK;
exit:
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave TWColorMoveToColorTemperature() with ret=%d", ret);
return ret;
OIC_LOG(INFO, TAG, "Enter CreatePAN()");
+ TWEntry* entry = NULL;
+ TWEntry* entry2 = NULL;
TWResultCode twRet1 = TW_RESULT_UNKNOWN;
TWResultCode twRet2 = TW_RESULT_UNKNOWN;
TWResultCode ret = TW_RESULT_UNKNOWN;
goto exit;
}
OIC_LOG_V(INFO, TAG, "Write %s", AT_CMD_GET_NETWORK_INFO);
- TWEntry* entry = NULL;
- TWEntry* entry2 = NULL;
ret = TWDequeueEntry(ctx->g_plugin, &entry, TW_NETWORK_INFO);
if (ret != TW_RESULT_OK)
{
}
exit:
- if (entry)
+ if (entry != NULL)
{
twRet1 = TWDeleteEntry(ctx->g_plugin, entry);
if(twRet1 != TW_RESULT_OK)
SEPARATOR_LENGTH + strlen(nodeId) +
SEPARATOR_LENGTH + strlen(endpoint) + 1;
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
}
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
ret = TWDequeueEntry(ctx->g_plugin, &entry, TW_SIMPLEDESC);
if (ret != TW_RESULT_OK)
{
}
exit:
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave FindClusters() with ret=%d", ret);
return ret;
int size = strlen(AT_CMD_REMOTE_EUI_REQUEST) + strlen(nodeId) +
SEPARATOR_LENGTH + strlen(nodeId) + 1;
+ TWEntry* entry = NULL;
+
char* cmdString = (char*)OICMalloc(size * sizeof(char));
if (cmdString == NULL)
{
}
OIC_LOG_V(INFO, TAG, "Write %s", cmdString);
- TWEntry* entry = NULL;
ret = TWDequeueEntry(ctx->g_plugin, &entry, TW_ADDRESS_RESPONSE);
if (ret != TW_RESULT_OK)
{
exit:
memset(ctx->g_WIPRemoteEUI, '\0', sizeof(ctx->g_WIPRemoteEUI));
memset(ctx->g_WIPRemoteNodeId, '\0', sizeof(ctx->g_WIPRemoteNodeId));
- TWDeleteEntry(ctx->g_plugin, entry);
+ if (entry != NULL)
+ {
+ TWDeleteEntry(ctx->g_plugin, entry);
+ }
OICFree(cmdString);
OIC_LOG_V(INFO, TAG, "Leave GetRemoteEUI() with ret=%d", ret);
return ret;
{
OIC_LOG(ERROR, TAG, "Invalid Params");
ret = TW_RESULT_ERROR_INVALID_PARAMS;
- goto exit;
+ goto exit;
}
if (ctx->g_WIPDevice == NULL)