mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 13:20:08 +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,17 +18,22 @@ OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_create(
|
|||
|
||||
void OpenAPI_sor_update_info_free(OpenAPI_sor_update_info_t *sor_update_info)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == sor_update_info) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_plmn_id_free(sor_update_info->vplmn_id);
|
||||
if (sor_update_info->vplmn_id) {
|
||||
OpenAPI_plmn_id_free(sor_update_info->vplmn_id);
|
||||
sor_update_info->vplmn_id = NULL;
|
||||
}
|
||||
ogs_free(sor_update_info);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_sor_update_info_convertToJSON(OpenAPI_sor_update_info_t *sor_update_info)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (sor_update_info == NULL) {
|
||||
ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [SorUpdateInfo]");
|
||||
|
|
@ -36,6 +41,10 @@ cJSON *OpenAPI_sor_update_info_convertToJSON(OpenAPI_sor_update_info_t *sor_upda
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!sor_update_info->vplmn_id) {
|
||||
ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]");
|
||||
return NULL;
|
||||
}
|
||||
cJSON *vplmn_id_local_JSON = OpenAPI_plmn_id_convertToJSON(sor_update_info->vplmn_id);
|
||||
if (vplmn_id_local_JSON == NULL) {
|
||||
ogs_error("OpenAPI_sor_update_info_convertToJSON() failed [vplmn_id]");
|
||||
|
|
@ -54,13 +63,14 @@ end:
|
|||
OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_parseFromJSON(cJSON *sor_update_infoJSON)
|
||||
{
|
||||
OpenAPI_sor_update_info_t *sor_update_info_local_var = NULL;
|
||||
cJSON *vplmn_id = cJSON_GetObjectItemCaseSensitive(sor_update_infoJSON, "vplmnId");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *vplmn_id = NULL;
|
||||
OpenAPI_plmn_id_t *vplmn_id_local_nonprim = NULL;
|
||||
vplmn_id = cJSON_GetObjectItemCaseSensitive(sor_update_infoJSON, "vplmnId");
|
||||
if (!vplmn_id) {
|
||||
ogs_error("OpenAPI_sor_update_info_parseFromJSON() failed [vplmn_id]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
OpenAPI_plmn_id_t *vplmn_id_local_nonprim = NULL;
|
||||
vplmn_id_local_nonprim = OpenAPI_plmn_id_parseFromJSON(vplmn_id);
|
||||
|
||||
sor_update_info_local_var = OpenAPI_sor_update_info_create (
|
||||
|
|
@ -69,6 +79,10 @@ OpenAPI_sor_update_info_t *OpenAPI_sor_update_info_parseFromJSON(cJSON *sor_upda
|
|||
|
||||
return sor_update_info_local_var;
|
||||
end:
|
||||
if (vplmn_id_local_nonprim) {
|
||||
OpenAPI_plmn_id_free(vplmn_id_local_nonprim);
|
||||
vplmn_id_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue