mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-03 05:40: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
|
|
@ -18,17 +18,22 @@ OpenAPI_trigger_request_t *OpenAPI_trigger_request_create(
|
|||
|
||||
void OpenAPI_trigger_request_free(OpenAPI_trigger_request_t *trigger_request)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == trigger_request) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
ogs_free(trigger_request->supi);
|
||||
if (trigger_request->supi) {
|
||||
ogs_free(trigger_request->supi);
|
||||
trigger_request->supi = NULL;
|
||||
}
|
||||
ogs_free(trigger_request);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_trigger_request_convertToJSON(OpenAPI_trigger_request_t *trigger_request)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (trigger_request == NULL) {
|
||||
ogs_error("OpenAPI_trigger_request_convertToJSON() failed [TriggerRequest]");
|
||||
|
|
@ -36,6 +41,10 @@ cJSON *OpenAPI_trigger_request_convertToJSON(OpenAPI_trigger_request_t *trigger_
|
|||
}
|
||||
|
||||
item = cJSON_CreateObject();
|
||||
if (!trigger_request->supi) {
|
||||
ogs_error("OpenAPI_trigger_request_convertToJSON() failed [supi]");
|
||||
return NULL;
|
||||
}
|
||||
if (cJSON_AddStringToObject(item, "supi", trigger_request->supi) == NULL) {
|
||||
ogs_error("OpenAPI_trigger_request_convertToJSON() failed [supi]");
|
||||
goto end;
|
||||
|
|
@ -48,12 +57,13 @@ end:
|
|||
OpenAPI_trigger_request_t *OpenAPI_trigger_request_parseFromJSON(cJSON *trigger_requestJSON)
|
||||
{
|
||||
OpenAPI_trigger_request_t *trigger_request_local_var = NULL;
|
||||
cJSON *supi = cJSON_GetObjectItemCaseSensitive(trigger_requestJSON, "supi");
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *supi = NULL;
|
||||
supi = cJSON_GetObjectItemCaseSensitive(trigger_requestJSON, "supi");
|
||||
if (!supi) {
|
||||
ogs_error("OpenAPI_trigger_request_parseFromJSON() failed [supi]");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!cJSON_IsString(supi)) {
|
||||
ogs_error("OpenAPI_trigger_request_parseFromJSON() failed [supi]");
|
||||
goto end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue