mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
[SBI] Crash occurs when ENUM in the MAP (#2103)
This commit is contained in:
parent
ce668c556c
commit
969c116e77
1097 changed files with 266728 additions and 42047 deletions
|
|
@ -18,20 +18,25 @@ OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification
|
|||
|
||||
void OpenAPI_amf_status_change_notification_free(OpenAPI_amf_status_change_notification_t *amf_status_change_notification)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == amf_status_change_notification) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) {
|
||||
OpenAPI_amf_status_info_free(node->data);
|
||||
if (amf_status_change_notification->amf_status_info_list) {
|
||||
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) {
|
||||
OpenAPI_amf_status_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_status_change_notification->amf_status_info_list);
|
||||
amf_status_change_notification->amf_status_info_list = NULL;
|
||||
}
|
||||
OpenAPI_list_free(amf_status_change_notification->amf_status_info_list);
|
||||
ogs_free(amf_status_change_notification);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_change_notification_t *amf_status_change_notification)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (amf_status_change_notification == NULL) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [AmfStatusChangeNotification]");
|
||||
|
|
@ -39,22 +44,22 @@ cJSON *OpenAPI_amf_status_change_notification_convertToJSON(OpenAPI_amf_status_c
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!amf_status_change_notification->amf_status_info_list) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *amf_status_info_listList = cJSON_AddArrayToObject(item, "amfStatusInfoList");
|
||||
if (amf_status_info_listList == NULL) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *amf_status_info_list_node;
|
||||
if (amf_status_change_notification->amf_status_info_list) {
|
||||
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, amf_status_info_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_amf_status_info_convertToJSON(amf_status_info_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(amf_status_info_listList, itemLocal);
|
||||
OpenAPI_list_for_each(amf_status_change_notification->amf_status_info_list, node) {
|
||||
cJSON *itemLocal = OpenAPI_amf_status_info_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_convertToJSON() failed [amf_status_info_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(amf_status_info_listList, itemLocal);
|
||||
}
|
||||
|
||||
end:
|
||||
|
|
@ -64,43 +69,49 @@ end:
|
|||
OpenAPI_amf_status_change_notification_t *OpenAPI_amf_status_change_notification_parseFromJSON(cJSON *amf_status_change_notificationJSON)
|
||||
{
|
||||
OpenAPI_amf_status_change_notification_t *amf_status_change_notification_local_var = NULL;
|
||||
cJSON *amf_status_info_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_notificationJSON, "amfStatusInfoList");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *amf_status_info_list = NULL;
|
||||
OpenAPI_list_t *amf_status_info_listList = NULL;
|
||||
amf_status_info_list = cJSON_GetObjectItemCaseSensitive(amf_status_change_notificationJSON, "amfStatusInfoList");
|
||||
if (!amf_status_info_list) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_list_t *amf_status_info_listList;
|
||||
cJSON *amf_status_info_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(amf_status_info_list)){
|
||||
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
amf_status_info_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(amf_status_info_list_local_nonprimitive, amf_status_info_list ) {
|
||||
if (!cJSON_IsObject(amf_status_info_list_local_nonprimitive)) {
|
||||
cJSON *amf_status_info_list_local = NULL;
|
||||
if (!cJSON_IsArray(amf_status_info_list)) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_amf_status_info_t *amf_status_info_listItem = OpenAPI_amf_status_info_parseFromJSON(amf_status_info_list_local_nonprimitive);
|
||||
|
||||
if (!amf_status_info_listItem) {
|
||||
ogs_error("No amf_status_info_listItem");
|
||||
OpenAPI_list_free(amf_status_info_listList);
|
||||
goto end;
|
||||
amf_status_info_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(amf_status_info_list_local, amf_status_info_list) {
|
||||
if (!cJSON_IsObject(amf_status_info_list_local)) {
|
||||
ogs_error("OpenAPI_amf_status_change_notification_parseFromJSON() failed [amf_status_info_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_amf_status_info_t *amf_status_info_listItem = OpenAPI_amf_status_info_parseFromJSON(amf_status_info_list_local);
|
||||
if (!amf_status_info_listItem) {
|
||||
ogs_error("No amf_status_info_listItem");
|
||||
OpenAPI_list_free(amf_status_info_listList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(amf_status_info_listList, amf_status_info_listItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(amf_status_info_listList, amf_status_info_listItem);
|
||||
}
|
||||
|
||||
amf_status_change_notification_local_var = OpenAPI_amf_status_change_notification_create (
|
||||
amf_status_info_listList
|
||||
);
|
||||
|
||||
return amf_status_change_notification_local_var;
|
||||
end:
|
||||
if (amf_status_info_listList) {
|
||||
OpenAPI_list_for_each(amf_status_info_listList, node) {
|
||||
OpenAPI_amf_status_info_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(amf_status_info_listList);
|
||||
amf_status_info_listList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue