summaryrefslogtreecommitdiff
path: root/src/agent/service-adapter/sa_session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/agent/service-adapter/sa_session.c')
-rwxr-xr-xsrc/agent/service-adapter/sa_session.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/agent/service-adapter/sa_session.c b/src/agent/service-adapter/sa_session.c
index 3ff27a1..6b0feae 100755
--- a/src/agent/service-adapter/sa_session.c
+++ b/src/agent/service-adapter/sa_session.c
@@ -903,6 +903,7 @@ static sa_error_type_e _receive_changes_command(session_s * session, command_s *
free_command(session->large_obj_cmd);
session->large_obj_cmd = NULL;
+ command = NULL;
} else {
status_s *temp = NULL;
errorType = create_new_status_location(session, ERROR_SIZE_MISMATCH, command, changedItem->source, changedItem->target, convert_command_type_change_type(changeType), &temp);
@@ -925,6 +926,7 @@ static sa_error_type_e _receive_changes_command(session_s * session, command_s *
}
}
}
+
if (changeType == CHANGE_ADD) {
int datastore_id = 0;
if (strcmp(changedItem->content_type, ELEMENT_TEXT_VCARD) == 0 || strcmp(changedItem->content_type, ELEMENT_TEXT_VCARD_30) == 0)
@@ -971,7 +973,10 @@ static sa_error_type_e _receive_changes_command(session_s * session, command_s *
}
status_s *temp = NULL;
- errorType = create_new_status_location(session, ERROR_UNKNOWN, command, changedItem->source, changedItem->target, convert_command_type_change_type(changeType), &temp);
+
+ if (command != NULL)
+ errorType = create_new_status_location(session, ERROR_UNKNOWN, command, changedItem->source, changedItem->target, convert_command_type_change_type(changeType), &temp);
+
if (errorType != SA_INTERNAL_OK) {
_DEBUG_ERROR("failed in create_new_status_location");
goto error;
@@ -985,8 +990,10 @@ static sa_error_type_e _receive_changes_command(session_s * session, command_s *
error:
- if (changed != NULL)
+ if (changed) {
free_changed_item(changed);
+ changed = NULL;
+ }
_INNER_FUNC_ENTER;
return errorType;
@@ -1485,6 +1492,7 @@ sa_error_type_e receive_commands(session_s * session, GList * receive_command, b
command = iter->data;
if (auto_config != true || (auto_config == true && command->type == COMMAND_TYPE_RESULTS)) {
+ _DEBUG_INFO("command->type = %d", command->type);
switch (command->type) {
case COMMAND_TYPE_UNKNOWN:
case COMMAND_TYPE_HEADER:
@@ -1525,7 +1533,7 @@ sa_error_type_e receive_commands(session_s * session, GList * receive_command, b
case COMMAND_TYPE_REPLACE:
case COMMAND_TYPE_DELETE:
{
- if (command->type != COMMAND_TYPE_ADD || luid_str_list != NULL) {
+ if (luid_str_list != NULL) {
errorType = _receive_changes_command(session, command, luid_str_list, &index, &changedDatastore);
} else {
_DEBUG_ERROR("luid_str_list is NULL !!");