mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 06:10:11 +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_hfc_node_id_t *OpenAPI_hfc_node_id_create(
|
|||
|
||||
void OpenAPI_hfc_node_id_free(OpenAPI_hfc_node_id_t *hfc_node_id)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == hfc_node_id) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(hfc_node_id->hfc_nid);
|
||||
if (hfc_node_id->hfc_nid) {
|
||||
ogs_free(hfc_node_id->hfc_nid);
|
||||
hfc_node_id->hfc_nid = NULL;
|
||||
}
|
||||
ogs_free(hfc_node_id);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_hfc_node_id_convertToJSON(OpenAPI_hfc_node_id_t *hfc_node_id)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (hfc_node_id == NULL) {
|
||||
ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [HfcNodeId]");
|
||||
|
|
@ -36,6 +41,10 @@ cJSON *OpenAPI_hfc_node_id_convertToJSON(OpenAPI_hfc_node_id_t *hfc_node_id)
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!hfc_node_id->hfc_nid) {
|
||||
ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_nid]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "hfcNId", hfc_node_id->hfc_nid) == NULL) {
|
||||
ogs_error("OpenAPI_hfc_node_id_convertToJSON() failed [hfc_nid]");
|
||||
goto end;
|
||||
|
|
@ -48,12 +57,13 @@ end:
|
|||
OpenAPI_hfc_node_id_t *OpenAPI_hfc_node_id_parseFromJSON(cJSON *hfc_node_idJSON)
|
||||
{
|
||||
OpenAPI_hfc_node_id_t *hfc_node_id_local_var = NULL;
|
||||
cJSON *hfc_nid = cJSON_GetObjectItemCaseSensitive(hfc_node_idJSON, "hfcNId");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *hfc_nid = NULL;
|
||||
hfc_nid = cJSON_GetObjectItemCaseSensitive(hfc_node_idJSON, "hfcNId");
|
||||
if (!hfc_nid) {
|
||||
ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_nid]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!cJSON_IsString(hfc_nid)) {
|
||||
ogs_error("OpenAPI_hfc_node_id_parseFromJSON() failed [hfc_nid]");
|
||||
goto end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue