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
|
|
@ -26,21 +26,38 @@ OpenAPI_released_data_t *OpenAPI_released_data_create(
|
|||
|
||||
void OpenAPI_released_data_free(OpenAPI_released_data_t *released_data)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == released_data) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_small_data_rate_status_free(released_data->small_data_rate_status);
|
||||
OpenAPI_apn_rate_status_free(released_data->apn_rate_status);
|
||||
OpenAPI_n4_information_free(released_data->n4_info);
|
||||
OpenAPI_n4_information_free(released_data->n4_info_ext1);
|
||||
OpenAPI_n4_information_free(released_data->n4_info_ext2);
|
||||
if (released_data->small_data_rate_status) {
|
||||
OpenAPI_small_data_rate_status_free(released_data->small_data_rate_status);
|
||||
released_data->small_data_rate_status = NULL;
|
||||
}
|
||||
if (released_data->apn_rate_status) {
|
||||
OpenAPI_apn_rate_status_free(released_data->apn_rate_status);
|
||||
released_data->apn_rate_status = NULL;
|
||||
}
|
||||
if (released_data->n4_info) {
|
||||
OpenAPI_n4_information_free(released_data->n4_info);
|
||||
released_data->n4_info = NULL;
|
||||
}
|
||||
if (released_data->n4_info_ext1) {
|
||||
OpenAPI_n4_information_free(released_data->n4_info_ext1);
|
||||
released_data->n4_info_ext1 = NULL;
|
||||
}
|
||||
if (released_data->n4_info_ext2) {
|
||||
OpenAPI_n4_information_free(released_data->n4_info_ext2);
|
||||
released_data->n4_info_ext2 = NULL;
|
||||
}
|
||||
ogs_free(released_data);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_released_data_convertToJSON(OpenAPI_released_data_t *released_data)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (released_data == NULL) {
|
||||
ogs_error("OpenAPI_released_data_convertToJSON() failed [ReleasedData]");
|
||||
|
|
@ -120,37 +137,38 @@ end:
|
|||
OpenAPI_released_data_t *OpenAPI_released_data_parseFromJSON(cJSON *released_dataJSON)
|
||||
{
|
||||
OpenAPI_released_data_t *released_data_local_var = NULL;
|
||||
cJSON *small_data_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "smallDataRateStatus");
|
||||
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *small_data_rate_status = NULL;
|
||||
OpenAPI_small_data_rate_status_t *small_data_rate_status_local_nonprim = NULL;
|
||||
cJSON *apn_rate_status = NULL;
|
||||
OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL;
|
||||
cJSON *n4_info = NULL;
|
||||
OpenAPI_n4_information_t *n4_info_local_nonprim = NULL;
|
||||
cJSON *n4_info_ext1 = NULL;
|
||||
OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL;
|
||||
cJSON *n4_info_ext2 = NULL;
|
||||
OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL;
|
||||
small_data_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "smallDataRateStatus");
|
||||
if (small_data_rate_status) {
|
||||
small_data_rate_status_local_nonprim = OpenAPI_small_data_rate_status_parseFromJSON(small_data_rate_status);
|
||||
}
|
||||
|
||||
cJSON *apn_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "apnRateStatus");
|
||||
|
||||
OpenAPI_apn_rate_status_t *apn_rate_status_local_nonprim = NULL;
|
||||
apn_rate_status = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "apnRateStatus");
|
||||
if (apn_rate_status) {
|
||||
apn_rate_status_local_nonprim = OpenAPI_apn_rate_status_parseFromJSON(apn_rate_status);
|
||||
}
|
||||
|
||||
cJSON *n4_info = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4Info");
|
||||
|
||||
OpenAPI_n4_information_t *n4_info_local_nonprim = NULL;
|
||||
n4_info = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4Info");
|
||||
if (n4_info) {
|
||||
n4_info_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info);
|
||||
}
|
||||
|
||||
cJSON *n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt1");
|
||||
|
||||
OpenAPI_n4_information_t *n4_info_ext1_local_nonprim = NULL;
|
||||
n4_info_ext1 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt1");
|
||||
if (n4_info_ext1) {
|
||||
n4_info_ext1_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext1);
|
||||
}
|
||||
|
||||
cJSON *n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt2");
|
||||
|
||||
OpenAPI_n4_information_t *n4_info_ext2_local_nonprim = NULL;
|
||||
n4_info_ext2 = cJSON_GetObjectItemCaseSensitive(released_dataJSON, "n4InfoExt2");
|
||||
if (n4_info_ext2) {
|
||||
n4_info_ext2_local_nonprim = OpenAPI_n4_information_parseFromJSON(n4_info_ext2);
|
||||
}
|
||||
|
|
@ -165,6 +183,26 @@ OpenAPI_released_data_t *OpenAPI_released_data_parseFromJSON(cJSON *released_dat
|
|||
|
||||
return released_data_local_var;
|
||||
end:
|
||||
if (small_data_rate_status_local_nonprim) {
|
||||
OpenAPI_small_data_rate_status_free(small_data_rate_status_local_nonprim);
|
||||
small_data_rate_status_local_nonprim = NULL;
|
||||
}
|
||||
if (apn_rate_status_local_nonprim) {
|
||||
OpenAPI_apn_rate_status_free(apn_rate_status_local_nonprim);
|
||||
apn_rate_status_local_nonprim = NULL;
|
||||
}
|
||||
if (n4_info_local_nonprim) {
|
||||
OpenAPI_n4_information_free(n4_info_local_nonprim);
|
||||
n4_info_local_nonprim = NULL;
|
||||
}
|
||||
if (n4_info_ext1_local_nonprim) {
|
||||
OpenAPI_n4_information_free(n4_info_ext1_local_nonprim);
|
||||
n4_info_ext1_local_nonprim = NULL;
|
||||
}
|
||||
if (n4_info_ext2_local_nonprim) {
|
||||
OpenAPI_n4_information_free(n4_info_ext2_local_nonprim);
|
||||
n4_info_ext2_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue