if (devInfDataStore->max_mem) {
char *str_maxmem = g_strdup_printf("%u", devInfDataStore->max_mem);
+ if (str_maxmem == NULL) {
+ err = SYNC_AGENT_PB_RETURN_OUT_OF_MEMORY;
+ goto error;
+ }
+
WBXMLTreeNode *maxmem_node = sync_agent_add_child_text_node(binder,
dsmem_node, ELEMENT_MAXMEM, str_maxmem, strlen(str_maxmem));
if (devInfDataStore->max_id) {
char *str_maxid = g_strdup_printf("%u", devInfDataStore->max_id);
+ if (str_maxid == NULL) {
+ err = SYNC_AGENT_PB_RETURN_OUT_OF_MEMORY;
+ goto error;
+ }
+
WBXMLTreeNode *maxid_node = sync_agent_add_child_text_node(binder,
dsmem_node, ELEMENT_MAXID, str_maxid, strlen(str_maxid));
if (pDevInfProperty != NULL)
free(pDevInfProperty);
+ if (pDevInfPropParam != NULL)
+ free(pDevInfPropParam);
+
goto return_part;
}
_DEBUG_TRACE("ParamName = [%s]", paramname);
da_err = sync_agent_get_folder_id_list(&query, &f_id_list);
if (da_err != SYNC_AGENT_DA_SUCCESS) {
- _DEBUG_ERROR("sync_agent_get_folder_id_list_inferface() failed !!");
+ _DEBUG_ERROR("sync_agent_get_folder_id_list_inferface() failed !!, da_err : [%d]", da_err);
goto error;
}
+ _DEBUG_INFO("id count : [%d]", g_list_length(f_id_list));
+ int i = 0;
+ for (i = 0; i < g_list_length(f_id_list); i++) {
+ char *data = (char *)g_list_nth_data(f_id_list, i);
+ _DEBUG_INFO("data[%d]: [%s]", i, data);
+ }
+
if (g_list_length(f_id_list) > 0) {
GList *iter = g_list_nth(f_id_list, 0);
folderId = (char *)(iter->data);
+ _DEBUG_INFO("iter data [%s]", iter->data);
} else {
_DEBUG_ERROR("failed to get folderId");
err = SE_INTERNAL_DA_ERROR;
for (changedIter = pSyncReturnChangedDatastore->change_item; changedIter != NULL; changedIter = g_list_next(changedIter)) {
changedItem = (changedIter->data);
- _DEBUG_VERBOSE("changedItem->changeType : %d", changedItem->change_type);
- _DEBUG_VERBOSE("changedItem->luid : %s", changedItem->luid);
- _DEBUG_VERBOSE("changedItem->content_type : %s", changedItem->content_type);
- _DEBUG_VERBOSE("changedItem->indexOfDatastore : %d", changedItem->index_of_datastore);
- _DEBUG_VERBOSE("changedItem->data : %s", changedItem->data);
+ _DEBUG_INFO("changedItem->luid : %s", changedItem->luid);
+ _DEBUG_INFO("changedItem->content_type : %s", changedItem->content_type);
+ _DEBUG_INFO("changedItem->indexOfDatastore : %d", changedItem->index_of_datastore);
+ _DEBUG_INFO("changedItem->data : %s", changedItem->data);
+ _DEBUG_INFO("changedItem->changeType : %d", changedItem->change_type);
add_receive_count(datastoreinfo_per_content_type[datastoreContentType]->server_sync_result, 1);
_DEBUG_ERROR("failed in sync_agent_generate_item_luid");
da_err = SYNC_AGENT_DA_ERRORS;
success = false;
+
+ if (id_list != NULL) {
+ free(id_list);
+ id_list = NULL;
+ }
} else {
int i = 0;
GList *iter = NULL;
fw_item->access_name = g_strdup("DACI_ChangeLog");
da_err = sync_agent_add_item(fw_item, &(id_list[i]), true);
- if (fw_item != NULL)
+ if (fw_item != NULL) {
sync_agent_free_item(fw_item);
+ fw_item = NULL;
+ }
free(fw_item_id_list[i]);
+ fw_item_id_list[i] = NULL;
free(id_list[i]);
+ id_list[i] = NULL;
i++;
}
if (fw_item_id_list != NULL) {
free(fw_item_id_list);
+ fw_item_id_list = NULL;
}
if (id_list != NULL) {
free(id_list);
+ id_list = NULL;
}
}
}
da_fail = true;
}
sync_agent_free_folder_list(folder_list);
+ folder_list = NULL;
- if (service_id != NULL)
+ if (service_id != NULL) {
free(service_id);
+ service_id = NULL;
+ }
} else if (da_err == SYNC_AGENT_DA_ERR_NOT_SUPPORTED || da_err == SYNC_AGENT_DA_ERR_INVALID_CONTENT || da_err == SYNC_AGENT_DA_ERR_ALREADY_EXIST) {
/*just return error to server */
da_fail = true;
}
- if (service_item != NULL)
+ if (service_item != NULL) {
sync_agent_free_service_item(service_item);
+ service_item = NULL;
+ }
- if (fw_id != NULL)
+ if (fw_id != NULL) {
free(fw_id);
+ fw_id = NULL;
+ }
} else
returnResult = COMMAND_RESULT_COMMAND_FAIL;
da_fail = true;
}
- if (service_item != NULL)
+ if (service_item != NULL) {
sync_agent_free_service_item(service_item);
+ service_item = NULL;
+ }
} else
returnResult = COMMAND_RESULT_COMMAND_FAIL;
da_fail = true;
}
sync_agent_free_item_list(item_list);
+ item_list = NULL;
break;
}
default:
free(tempServerSyncResult);
tempServerSyncResult = NULL;
}
+ sync_agent_free_folder_id_list(f_id_list);
+ f_id_list = NULL;
}
error:
+
sync_agent_free_folder_id_list(f_id_list);
+ f_id_list = NULL;
- if (tempServerSyncResult != NULL)
+ if (tempServerSyncResult != NULL) {
free(tempServerSyncResult);
+ tempServerSyncResult = NULL;
+ }
/* for prevent */
free_sending_status(sendingStatus);
+ sendingStatus = NULL;
_INNER_FUNC_EXIT;
return err;