[SBI] Crash occurs when ENUM in the MAP (#2103)

This commit is contained in:
Sukchan Lee 2023-03-01 17:50:25 +09:00
parent ce668c556c
commit 969c116e77
1097 changed files with 266728 additions and 42047 deletions

View file

@ -20,20 +20,25 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
void OpenAPI_access_net_charging_identifier_free(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == access_net_charging_identifier) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(access_net_charging_identifier->flows, node) {
OpenAPI_flows_free(node->data);
if (access_net_charging_identifier->flows) {
OpenAPI_list_for_each(access_net_charging_identifier->flows, node) {
OpenAPI_flows_free(node->data);
}
OpenAPI_list_free(access_net_charging_identifier->flows);
access_net_charging_identifier->flows = NULL;
}
OpenAPI_list_free(access_net_charging_identifier->flows);
ogs_free(access_net_charging_identifier);
}
cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (access_net_charging_identifier == NULL) {
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [AccessNetChargingIdentifier]");
@ -52,17 +57,13 @@ cJSON *OpenAPI_access_net_charging_identifier_convertToJSON(OpenAPI_access_net_c
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]");
goto end;
}
OpenAPI_lnode_t *flows_node;
if (access_net_charging_identifier->flows) {
OpenAPI_list_for_each(access_net_charging_identifier->flows, flows_node) {
cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]");
goto end;
}
cJSON_AddItemToArray(flowsList, itemLocal);
OpenAPI_list_for_each(access_net_charging_identifier->flows, node) {
cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_access_net_charging_identifier_convertToJSON() failed [flows]");
goto end;
}
cJSON_AddItemToArray(flowsList, itemLocal);
}
}
@ -73,44 +74,43 @@ end:
OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier_parseFromJSON(cJSON *access_net_charging_identifierJSON)
{
OpenAPI_access_net_charging_identifier_t *access_net_charging_identifier_local_var = NULL;
cJSON *acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChaIdValue");
OpenAPI_lnode_t *node = NULL;
cJSON *acc_net_cha_id_value = NULL;
cJSON *flows = NULL;
OpenAPI_list_t *flowsList = NULL;
acc_net_cha_id_value = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "accNetChaIdValue");
if (!acc_net_cha_id_value) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]");
goto end;
}
if (!cJSON_IsNumber(acc_net_cha_id_value)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [acc_net_cha_id_value]");
goto end;
}
cJSON *flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows");
OpenAPI_list_t *flowsList;
flows = cJSON_GetObjectItemCaseSensitive(access_net_charging_identifierJSON, "flows");
if (flows) {
cJSON *flows_local_nonprimitive;
if (!cJSON_IsArray(flows)){
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local_nonprimitive, flows ) {
if (!cJSON_IsObject(flows_local_nonprimitive)) {
cJSON *flows_local = NULL;
if (!cJSON_IsArray(flows)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local_nonprimitive);
if (!flowsItem) {
ogs_error("No flowsItem");
OpenAPI_list_free(flowsList);
goto end;
flowsList = OpenAPI_list_create();
cJSON_ArrayForEach(flows_local, flows) {
if (!cJSON_IsObject(flows_local)) {
ogs_error("OpenAPI_access_net_charging_identifier_parseFromJSON() failed [flows]");
goto end;
}
OpenAPI_flows_t *flowsItem = OpenAPI_flows_parseFromJSON(flows_local);
if (!flowsItem) {
ogs_error("No flowsItem");
OpenAPI_list_free(flowsList);
goto end;
}
OpenAPI_list_add(flowsList, flowsItem);
}
OpenAPI_list_add(flowsList, flowsItem);
}
}
access_net_charging_identifier_local_var = OpenAPI_access_net_charging_identifier_create (
@ -121,6 +121,13 @@ OpenAPI_access_net_charging_identifier_t *OpenAPI_access_net_charging_identifier
return access_net_charging_identifier_local_var;
end:
if (flowsList) {
OpenAPI_list_for_each(flowsList, node) {
OpenAPI_flows_free(node->data);
}
OpenAPI_list_free(flowsList);
flowsList = NULL;
}
return NULL;
}