mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-05 23:37:22 +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_guami_list_cond_t *OpenAPI_guami_list_cond_create(
|
|||
|
||||
void OpenAPI_guami_list_cond_free(OpenAPI_guami_list_cond_t *guami_list_cond)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == guami_list_cond) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_list_for_each(guami_list_cond->guami_list, node) {
|
||||
OpenAPI_guami_free(node->data);
|
||||
if (guami_list_cond->guami_list) {
|
||||
OpenAPI_list_for_each(guami_list_cond->guami_list, node) {
|
||||
OpenAPI_guami_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(guami_list_cond->guami_list);
|
||||
guami_list_cond->guami_list = NULL;
|
||||
}
|
||||
OpenAPI_list_free(guami_list_cond->guami_list);
|
||||
ogs_free(guami_list_cond);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_guami_list_cond_convertToJSON(OpenAPI_guami_list_cond_t *guami_list_cond)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (guami_list_cond == NULL) {
|
||||
ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [GuamiListCond]");
|
||||
|
|
@ -39,22 +44,22 @@ cJSON *OpenAPI_guami_list_cond_convertToJSON(OpenAPI_guami_list_cond_t *guami_li
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!guami_list_cond->guami_list) {
|
||||
ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *guami_listList = cJSON_AddArrayToObject(item, "guamiList");
|
||||
if (guami_listList == NULL) {
|
||||
ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_lnode_t *guami_list_node;
|
||||
if (guami_list_cond->guami_list) {
|
||||
OpenAPI_list_for_each(guami_list_cond->guami_list, guami_list_node) {
|
||||
cJSON *itemLocal = OpenAPI_guami_convertToJSON(guami_list_node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(guami_listList, itemLocal);
|
||||
OpenAPI_list_for_each(guami_list_cond->guami_list, node) {
|
||||
cJSON *itemLocal = OpenAPI_guami_convertToJSON(node->data);
|
||||
if (itemLocal == NULL) {
|
||||
ogs_error("OpenAPI_guami_list_cond_convertToJSON() failed [guami_list]");
|
||||
goto end;
|
||||
}
|
||||
cJSON_AddItemToArray(guami_listList, itemLocal);
|
||||
}
|
||||
|
||||
end:
|
||||
|
|
@ -64,43 +69,49 @@ end:
|
|||
OpenAPI_guami_list_cond_t *OpenAPI_guami_list_cond_parseFromJSON(cJSON *guami_list_condJSON)
|
||||
{
|
||||
OpenAPI_guami_list_cond_t *guami_list_cond_local_var = NULL;
|
||||
cJSON *guami_list = cJSON_GetObjectItemCaseSensitive(guami_list_condJSON, "guamiList");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *guami_list = NULL;
|
||||
OpenAPI_list_t *guami_listList = NULL;
|
||||
guami_list = cJSON_GetObjectItemCaseSensitive(guami_list_condJSON, "guamiList");
|
||||
if (!guami_list) {
|
||||
ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_list_t *guami_listList;
|
||||
cJSON *guami_list_local_nonprimitive;
|
||||
if (!cJSON_IsArray(guami_list)){
|
||||
ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
guami_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(guami_list_local_nonprimitive, guami_list ) {
|
||||
if (!cJSON_IsObject(guami_list_local_nonprimitive)) {
|
||||
cJSON *guami_list_local = NULL;
|
||||
if (!cJSON_IsArray(guami_list)) {
|
||||
ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local_nonprimitive);
|
||||
|
||||
if (!guami_listItem) {
|
||||
ogs_error("No guami_listItem");
|
||||
OpenAPI_list_free(guami_listList);
|
||||
goto end;
|
||||
guami_listList = OpenAPI_list_create();
|
||||
|
||||
cJSON_ArrayForEach(guami_list_local, guami_list) {
|
||||
if (!cJSON_IsObject(guami_list_local)) {
|
||||
ogs_error("OpenAPI_guami_list_cond_parseFromJSON() failed [guami_list]");
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_guami_t *guami_listItem = OpenAPI_guami_parseFromJSON(guami_list_local);
|
||||
if (!guami_listItem) {
|
||||
ogs_error("No guami_listItem");
|
||||
OpenAPI_list_free(guami_listList);
|
||||
goto end;
|
||||
}
|
||||
OpenAPI_list_add(guami_listList, guami_listItem);
|
||||
}
|
||||
|
||||
OpenAPI_list_add(guami_listList, guami_listItem);
|
||||
}
|
||||
|
||||
guami_list_cond_local_var = OpenAPI_guami_list_cond_create (
|
||||
guami_listList
|
||||
);
|
||||
|
||||
return guami_list_cond_local_var;
|
||||
end:
|
||||
if (guami_listList) {
|
||||
OpenAPI_list_for_each(guami_listList, node) {
|
||||
OpenAPI_guami_free(node->data);
|
||||
}
|
||||
OpenAPI_list_free(guami_listList);
|
||||
guami_listList = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue