[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

@ -22,25 +22,36 @@ OpenAPI_location_area_1_t *OpenAPI_location_area_1_create(
void OpenAPI_location_area_1_free(OpenAPI_location_area_1_t *location_area_1)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == location_area_1) {
return;
}
OpenAPI_lnode_t *node;
OpenAPI_list_for_each(location_area_1->geographic_areas, node) {
OpenAPI_geographic_area_free(node->data);
if (location_area_1->geographic_areas) {
OpenAPI_list_for_each(location_area_1->geographic_areas, node) {
OpenAPI_geographic_area_free(node->data);
}
OpenAPI_list_free(location_area_1->geographic_areas);
location_area_1->geographic_areas = NULL;
}
OpenAPI_list_free(location_area_1->geographic_areas);
OpenAPI_list_for_each(location_area_1->civic_addresses, node) {
OpenAPI_civic_address_free(node->data);
if (location_area_1->civic_addresses) {
OpenAPI_list_for_each(location_area_1->civic_addresses, node) {
OpenAPI_civic_address_free(node->data);
}
OpenAPI_list_free(location_area_1->civic_addresses);
location_area_1->civic_addresses = NULL;
}
if (location_area_1->nw_area_info) {
OpenAPI_network_area_info_1_free(location_area_1->nw_area_info);
location_area_1->nw_area_info = NULL;
}
OpenAPI_list_free(location_area_1->civic_addresses);
OpenAPI_network_area_info_1_free(location_area_1->nw_area_info);
ogs_free(location_area_1);
}
cJSON *OpenAPI_location_area_1_convertToJSON(OpenAPI_location_area_1_t *location_area_1)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (location_area_1 == NULL) {
ogs_error("OpenAPI_location_area_1_convertToJSON() failed [LocationArea_1]");
@ -54,17 +65,13 @@ cJSON *OpenAPI_location_area_1_convertToJSON(OpenAPI_location_area_1_t *location
ogs_error("OpenAPI_location_area_1_convertToJSON() failed [geographic_areas]");
goto end;
}
OpenAPI_lnode_t *geographic_areas_node;
if (location_area_1->geographic_areas) {
OpenAPI_list_for_each(location_area_1->geographic_areas, geographic_areas_node) {
cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(geographic_areas_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_location_area_1_convertToJSON() failed [geographic_areas]");
goto end;
}
cJSON_AddItemToArray(geographic_areasList, itemLocal);
OpenAPI_list_for_each(location_area_1->geographic_areas, node) {
cJSON *itemLocal = OpenAPI_geographic_area_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_location_area_1_convertToJSON() failed [geographic_areas]");
goto end;
}
cJSON_AddItemToArray(geographic_areasList, itemLocal);
}
}
@ -74,17 +81,13 @@ cJSON *OpenAPI_location_area_1_convertToJSON(OpenAPI_location_area_1_t *location
ogs_error("OpenAPI_location_area_1_convertToJSON() failed [civic_addresses]");
goto end;
}
OpenAPI_lnode_t *civic_addresses_node;
if (location_area_1->civic_addresses) {
OpenAPI_list_for_each(location_area_1->civic_addresses, civic_addresses_node) {
cJSON *itemLocal = OpenAPI_civic_address_convertToJSON(civic_addresses_node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_location_area_1_convertToJSON() failed [civic_addresses]");
goto end;
}
cJSON_AddItemToArray(civic_addressesList, itemLocal);
OpenAPI_list_for_each(location_area_1->civic_addresses, node) {
cJSON *itemLocal = OpenAPI_civic_address_convertToJSON(node->data);
if (itemLocal == NULL) {
ogs_error("OpenAPI_location_area_1_convertToJSON() failed [civic_addresses]");
goto end;
}
cJSON_AddItemToArray(civic_addressesList, itemLocal);
}
}
@ -108,67 +111,64 @@ end:
OpenAPI_location_area_1_t *OpenAPI_location_area_1_parseFromJSON(cJSON *location_area_1JSON)
{
OpenAPI_location_area_1_t *location_area_1_local_var = NULL;
cJSON *geographic_areas = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "geographicAreas");
OpenAPI_list_t *geographic_areasList;
OpenAPI_lnode_t *node = NULL;
cJSON *geographic_areas = NULL;
OpenAPI_list_t *geographic_areasList = NULL;
cJSON *civic_addresses = NULL;
OpenAPI_list_t *civic_addressesList = NULL;
cJSON *nw_area_info = NULL;
OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL;
geographic_areas = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "geographicAreas");
if (geographic_areas) {
cJSON *geographic_areas_local_nonprimitive;
if (!cJSON_IsArray(geographic_areas)){
ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [geographic_areas]");
goto end;
}
geographic_areasList = OpenAPI_list_create();
cJSON_ArrayForEach(geographic_areas_local_nonprimitive, geographic_areas ) {
if (!cJSON_IsObject(geographic_areas_local_nonprimitive)) {
cJSON *geographic_areas_local = NULL;
if (!cJSON_IsArray(geographic_areas)) {
ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [geographic_areas]");
goto end;
}
OpenAPI_geographic_area_t *geographic_areasItem = OpenAPI_geographic_area_parseFromJSON(geographic_areas_local_nonprimitive);
if (!geographic_areasItem) {
ogs_error("No geographic_areasItem");
OpenAPI_list_free(geographic_areasList);
goto end;
geographic_areasList = OpenAPI_list_create();
cJSON_ArrayForEach(geographic_areas_local, geographic_areas) {
if (!cJSON_IsObject(geographic_areas_local)) {
ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [geographic_areas]");
goto end;
}
OpenAPI_geographic_area_t *geographic_areasItem = OpenAPI_geographic_area_parseFromJSON(geographic_areas_local);
if (!geographic_areasItem) {
ogs_error("No geographic_areasItem");
OpenAPI_list_free(geographic_areasList);
goto end;
}
OpenAPI_list_add(geographic_areasList, geographic_areasItem);
}
OpenAPI_list_add(geographic_areasList, geographic_areasItem);
}
}
cJSON *civic_addresses = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "civicAddresses");
OpenAPI_list_t *civic_addressesList;
civic_addresses = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "civicAddresses");
if (civic_addresses) {
cJSON *civic_addresses_local_nonprimitive;
if (!cJSON_IsArray(civic_addresses)){
ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [civic_addresses]");
goto end;
}
civic_addressesList = OpenAPI_list_create();
cJSON_ArrayForEach(civic_addresses_local_nonprimitive, civic_addresses ) {
if (!cJSON_IsObject(civic_addresses_local_nonprimitive)) {
cJSON *civic_addresses_local = NULL;
if (!cJSON_IsArray(civic_addresses)) {
ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [civic_addresses]");
goto end;
}
OpenAPI_civic_address_t *civic_addressesItem = OpenAPI_civic_address_parseFromJSON(civic_addresses_local_nonprimitive);
if (!civic_addressesItem) {
ogs_error("No civic_addressesItem");
OpenAPI_list_free(civic_addressesList);
goto end;
civic_addressesList = OpenAPI_list_create();
cJSON_ArrayForEach(civic_addresses_local, civic_addresses) {
if (!cJSON_IsObject(civic_addresses_local)) {
ogs_error("OpenAPI_location_area_1_parseFromJSON() failed [civic_addresses]");
goto end;
}
OpenAPI_civic_address_t *civic_addressesItem = OpenAPI_civic_address_parseFromJSON(civic_addresses_local);
if (!civic_addressesItem) {
ogs_error("No civic_addressesItem");
OpenAPI_list_free(civic_addressesList);
goto end;
}
OpenAPI_list_add(civic_addressesList, civic_addressesItem);
}
OpenAPI_list_add(civic_addressesList, civic_addressesItem);
}
}
cJSON *nw_area_info = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "nwAreaInfo");
OpenAPI_network_area_info_1_t *nw_area_info_local_nonprim = NULL;
nw_area_info = cJSON_GetObjectItemCaseSensitive(location_area_1JSON, "nwAreaInfo");
if (nw_area_info) {
nw_area_info_local_nonprim = OpenAPI_network_area_info_1_parseFromJSON(nw_area_info);
}
@ -181,6 +181,24 @@ OpenAPI_location_area_1_t *OpenAPI_location_area_1_parseFromJSON(cJSON *location
return location_area_1_local_var;
end:
if (geographic_areasList) {
OpenAPI_list_for_each(geographic_areasList, node) {
OpenAPI_geographic_area_free(node->data);
}
OpenAPI_list_free(geographic_areasList);
geographic_areasList = NULL;
}
if (civic_addressesList) {
OpenAPI_list_for_each(civic_addressesList, node) {
OpenAPI_civic_address_free(node->data);
}
OpenAPI_list_free(civic_addressesList);
civic_addressesList = NULL;
}
if (nw_area_info_local_nonprim) {
OpenAPI_network_area_info_1_free(nw_area_info_local_nonprim);
nw_area_info_local_nonprim = NULL;
}
return NULL;
}