mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 15:24:14 +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
|
|
@ -20,21 +20,29 @@ OpenAPI_out_of_credit_information_t *OpenAPI_out_of_credit_information_create(
|
|||
|
||||
void OpenAPI_out_of_credit_information_free(OpenAPI_out_of_credit_information_t *out_of_credit_information)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == out_of_credit_information) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_final_unit_action_free(out_of_credit_information->fin_unit_act);
|
||||
OpenAPI_list_for_each(out_of_credit_information->flows, node) {
|
||||
OpenAPI_flows_free(node->data);
|
||||
if (out_of_credit_information->fin_unit_act) {
|
||||
OpenAPI_final_unit_action_free(out_of_credit_information->fin_unit_act);
|
||||
out_of_credit_information->fin_unit_act = NULL;
|
||||
}
|
||||
if (out_of_credit_information->flows) {
|
||||
OpenAPI_list_for_each(out_of_credit_information->flows, node) {
|
||||
OpenAPI_flows_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(out_of_credit_information->flows);
|
||||
out_of_credit_information->flows = NULL;
|
||||
}
|
||||
OpenAPI_list_free(out_of_credit_information->flows);
|
||||
ogs_free(out_of_credit_information);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_out_of_credit_information_convertToJSON(OpenAPI_out_of_credit_information_t *out_of_credit_information)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (out_of_credit_information == NULL) {
|
||||
ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [OutOfCreditInformation]");
|
||||
|
|
@ -42,6 +50,10 @@ cJSON *OpenAPI_out_of_credit_information_convertToJSON(OpenAPI_out_of_credit_inf
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!out_of_credit_information->fin_unit_act) {
|
||||
ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [fin_unit_act]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *fin_unit_act_local_JSON = OpenAPI_final_unit_action_convertToJSON(out_of_credit_information->fin_unit_act);
|
||||
if (fin_unit_act_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [fin_unit_act]");
|
||||
|
|
@ -59,17 +71,13 @@ cJSON *OpenAPI_out_of_credit_information_convertToJSON(OpenAPI_out_of_credit_inf
|
|||
ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [flows]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *flows_node;
|
||||
if (out_of_credit_information->flows) {
|
||||
OpenAPI_list_for_each(out_of_credit_information->flows, flows_node) {
|
||||
cJSON *itemLocal = OpenAPI_flows_convertToJSON(flows_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [flows]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(flowsList, itemLocal);
|
||||
OpenAPI_list_for_each(out_of_credit_information->flows, node) {
|
||||
cJSON *itemLocal = OpenAPI_flows_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_out_of_credit_information_convertToJSON() failed [flows]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(flowsList, itemLocal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -80,42 +88,41 @@ end:
|
|||
OpenAPI_out_of_credit_information_t *OpenAPI_out_of_credit_information_parseFromJSON(cJSON *out_of_credit_informationJSON)
|
||||
{
|
||||
OpenAPI_out_of_credit_information_t *out_of_credit_information_local_var = NULL;
|
||||
cJSON *fin_unit_act = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "finUnitAct");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *fin_unit_act = NULL;
|
||||
OpenAPI_final_unit_action_t *fin_unit_act_local_nonprim = NULL;
|
||||
cJSON *flows = NULL;
|
||||
OpenAPI_list_t *flowsList = NULL;
|
||||
fin_unit_act = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "finUnitAct");
|
||||
if (!fin_unit_act) {
|
||||
ogs_error("OpenAPI_out_of_credit_information_parseFromJSON() failed [fin_unit_act]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_final_unit_action_t *fin_unit_act_local_nonprim = NULL;
|
||||
fin_unit_act_local_nonprim = OpenAPI_final_unit_action_parseFromJSON(fin_unit_act);
|
||||
|
||||
cJSON *flows = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "flows");
|
||||
|
||||
OpenAPI_list_t *flowsList;
|
||||
flows = cJSON_GetObjectItemCaseSensitive(out_of_credit_informationJSON, "flows");
|
||||
if (flows) {
|
||||
cJSON *flows_local_nonprimitive;
|
||||
if (!cJSON_IsArray(flows)){
|
||||
ogs_error("OpenAPI_out_of_credit_information_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_out_of_credit_information_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_out_of_credit_information_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);
|
||||
}
|
||||
}
|
||||
|
||||
out_of_credit_information_local_var = OpenAPI_out_of_credit_information_create (
|
||||
|
|
@ -125,6 +132,17 @@ OpenAPI_out_of_credit_information_t *OpenAPI_out_of_credit_information_parseFrom
|
|||
|
||||
return out_of_credit_information_local_var;
|
||||
end:
|
||||
if (fin_unit_act_local_nonprim) {
|
||||
OpenAPI_final_unit_action_free(fin_unit_act_local_nonprim);
|
||||
fin_unit_act_local_nonprim = NULL;
|
||||
}
|
||||
if (flowsList) {
|
||||
OpenAPI_list_for_each(flowsList, node) {
|
||||
OpenAPI_flows_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(flowsList);
|
||||
flowsList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue