mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 21:30:10 +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
|
|
@ -22,19 +22,30 @@ OpenAPI_app_session_context_t *OpenAPI_app_session_context_create(
|
|||
|
||||
void OpenAPI_app_session_context_free(OpenAPI_app_session_context_t *app_session_context)
|
||||
{
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (NULL == app_session_context) {
|
||||
return;
|
||||
}
|
||||
OpenAPI_lnode_t *node;
|
||||
OpenAPI_app_session_context_req_data_free(app_session_context->asc_req_data);
|
||||
OpenAPI_app_session_context_resp_data_free(app_session_context->asc_resp_data);
|
||||
OpenAPI_events_notification_free(app_session_context->evs_notif);
|
||||
if (app_session_context->asc_req_data) {
|
||||
OpenAPI_app_session_context_req_data_free(app_session_context->asc_req_data);
|
||||
app_session_context->asc_req_data = NULL;
|
||||
}
|
||||
if (app_session_context->asc_resp_data) {
|
||||
OpenAPI_app_session_context_resp_data_free(app_session_context->asc_resp_data);
|
||||
app_session_context->asc_resp_data = NULL;
|
||||
}
|
||||
if (app_session_context->evs_notif) {
|
||||
OpenAPI_events_notification_free(app_session_context->evs_notif);
|
||||
app_session_context->evs_notif = NULL;
|
||||
}
|
||||
ogs_free(app_session_context);
|
||||
}
|
||||
|
||||
cJSON *OpenAPI_app_session_context_convertToJSON(OpenAPI_app_session_context_t *app_session_context)
|
||||
{
|
||||
cJSON *item = NULL;
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
|
||||
if (app_session_context == NULL) {
|
||||
ogs_error("OpenAPI_app_session_context_convertToJSON() failed [AppSessionContext]");
|
||||
|
|
@ -88,23 +99,24 @@ end:
|
|||
OpenAPI_app_session_context_t *OpenAPI_app_session_context_parseFromJSON(cJSON *app_session_contextJSON)
|
||||
{
|
||||
OpenAPI_app_session_context_t *app_session_context_local_var = NULL;
|
||||
cJSON *asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascReqData");
|
||||
|
||||
OpenAPI_lnode_t *node = NULL;
|
||||
cJSON *asc_req_data = NULL;
|
||||
OpenAPI_app_session_context_req_data_t *asc_req_data_local_nonprim = NULL;
|
||||
cJSON *asc_resp_data = NULL;
|
||||
OpenAPI_app_session_context_resp_data_t *asc_resp_data_local_nonprim = NULL;
|
||||
cJSON *evs_notif = NULL;
|
||||
OpenAPI_events_notification_t *evs_notif_local_nonprim = NULL;
|
||||
asc_req_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascReqData");
|
||||
if (asc_req_data) {
|
||||
asc_req_data_local_nonprim = OpenAPI_app_session_context_req_data_parseFromJSON(asc_req_data);
|
||||
}
|
||||
|
||||
cJSON *asc_resp_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascRespData");
|
||||
|
||||
OpenAPI_app_session_context_resp_data_t *asc_resp_data_local_nonprim = NULL;
|
||||
asc_resp_data = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "ascRespData");
|
||||
if (asc_resp_data) {
|
||||
asc_resp_data_local_nonprim = OpenAPI_app_session_context_resp_data_parseFromJSON(asc_resp_data);
|
||||
}
|
||||
|
||||
cJSON *evs_notif = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "evsNotif");
|
||||
|
||||
OpenAPI_events_notification_t *evs_notif_local_nonprim = NULL;
|
||||
evs_notif = cJSON_GetObjectItemCaseSensitive(app_session_contextJSON, "evsNotif");
|
||||
if (evs_notif) {
|
||||
evs_notif_local_nonprim = OpenAPI_events_notification_parseFromJSON(evs_notif);
|
||||
}
|
||||
|
|
@ -117,6 +129,18 @@ OpenAPI_app_session_context_t *OpenAPI_app_session_context_parseFromJSON(cJSON *
|
|||
|
||||
return app_session_context_local_var;
|
||||
end:
|
||||
if (asc_req_data_local_nonprim) {
|
||||
OpenAPI_app_session_context_req_data_free(asc_req_data_local_nonprim);
|
||||
asc_req_data_local_nonprim = NULL;
|
||||
}
|
||||
if (asc_resp_data_local_nonprim) {
|
||||
OpenAPI_app_session_context_resp_data_free(asc_resp_data_local_nonprim);
|
||||
asc_resp_data_local_nonprim = NULL;
|
||||
}
|
||||
if (evs_notif_local_nonprim) {
|
||||
OpenAPI_events_notification_free(evs_notif_local_nonprim);
|
||||
evs_notif_local_nonprim = NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue