}
WBXMLTree *wbxml_tree = NULL;
+ WBXMLList *alertnode_list = NULL;
WBXMLError wbxml_err = wbxml_tree_from_wbxml((unsigned char *)msg_body, msg_size, WBXML_LANG_UNKNOWN, WBXML_CHARSET_UNKNOWN, &wbxml_tree);
if (wbxml_err != WBXML_OK) {
goto error;
}
- WBXMLList *alertnode_list = wbxml_tree_node_get_all_children(syncbody_node);
+ alertnode_list = wbxml_tree_node_get_all_children(syncbody_node);
unsigned int alertnode_list_len = wbxml_list_len(alertnode_list);
child_node = (WBXMLTreeNode *) wbxml_list_get(alertnode_list, alertnode_list_len - 1);
if (san->cnt_sync_alerts == 0) {
/* If number of sync alerts equals 0, should sync all data store in the client */
+ wbxml_list_destroy(alertnode_list, NULL);
return san;
} else {
san->sync_alerts = (san_sync_alert_s *) calloc(san->cnt_sync_alerts, sizeof(san_sync_alert_s));
}
}
+ wbxml_list_destroy(alertnode_list, NULL);
wbxml_tree_destroy(wbxml_tree);
_EXTERN_FUNC_EXIT;
error:
+ wbxml_list_destroy(alertnode_list, NULL);
+ wbxml_tree_destroy(wbxml_tree);
+
sanPackageParserFree(san);
_EXTERN_FUNC_EXIT;
if (pDevInfCtCap != NULL)
free(pDevInfCtCap);
- if (devinf_content_type != NULL)
- free(devinf_content_type);
-
goto return_part;
}
}
_EXTERN_FUNC_ENTER;
_DEBUG_INFO("start Errortype %d", data);
+ retvm_if(session == NULL, SA_INTERNAL_ERROR, "session is NULL!!");
+ retvm_if(command == NULL, SA_INTERNAL_ERROR, "command is NULL!!");
+
sa_error_type_e errorType = SA_INTERNAL_OK;
errorType = create_status(data, session->cmd_id, session->last_recieved_msg_id, command->cmd_id, source_ref, target_ref, type, status);
_EXTERN_FUNC_ENTER;
_DEBUG_INFO("start Errortype %d", data);
+ retvm_if(session == NULL, SA_INTERNAL_ERROR, "session is NULL!!");
+ retvm_if(command == NULL, SA_INTERNAL_ERROR, "command is NULL!!");
+
sa_error_type_e errorType = SA_INTERNAL_OK;
errorType = create_status(data, session->cmd_id, session->last_recieved_msg_id, command->cmd_id, command->source, command->target, type, status);
return errorType;
error:
- if (pSyncHdr != NULL)
+ if (pSyncHdr != NULL) {
free_sync_hdr(pSyncHdr);
- if (pCred != NULL)
+ pSyncHdr = NULL;
+ }
+ if (pCred != NULL) {
free_cred(pCred);
- if (credData != NULL)
+ pCred = NULL;
+ }
+ if (credData != NULL) {
free(credData);
- if (commands != NULL)
+ credData = NULL;
+ }
+ if (pGetCommand != NULL) {
+ free_command(pGetCommand);
+ pGetCommand = NULL;
+ }
+ if (commands != NULL) {
free_commands(commands);
- if (syncml != NULL)
+ commands = NULL;
+ }
+ if (syncml != NULL) {
free(syncml);
+ syncml = NULL;
+ }
_INNER_FUNC_EXIT;
return errorType;