[SBI] Crash occurs when ENUM in the MAP (#2103)

This commit is contained in:
Sukchan Lee 2023-03-01 17:50:25 +09:00
parent ce668c556c
commit 969c116e77
1097 changed files with 266728 additions and 42047 deletions

View file

@ -18,17 +18,22 @@ OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_create(
void OpenAPI_nf_service_set_cond_free(OpenAPI_nf_service_set_cond_t *nf_service_set_cond)
{
OpenAPI_lnode_t *node = NULL;
if (NULL == nf_service_set_cond) {
return;
}
OpenAPI_lnode_t *node;
ogs_free(nf_service_set_cond->nf_service_set_id);
if (nf_service_set_cond->nf_service_set_id) {
ogs_free(nf_service_set_cond->nf_service_set_id);
nf_service_set_cond->nf_service_set_id = NULL;
}
ogs_free(nf_service_set_cond);
}
cJSON *OpenAPI_nf_service_set_cond_convertToJSON(OpenAPI_nf_service_set_cond_t *nf_service_set_cond)
{
cJSON *item = NULL;
OpenAPI_lnode_t *node = NULL;
if (nf_service_set_cond == NULL) {
ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [NfServiceSetCond]");
@ -36,6 +41,10 @@ cJSON *OpenAPI_nf_service_set_cond_convertToJSON(OpenAPI_nf_service_set_cond_t *
}
item = cJSON_CreateObject();
if (!nf_service_set_cond->nf_service_set_id) {
ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [nf_service_set_id]");
return NULL;
}
if (cJSON_AddStringToObject(item, "nfServiceSetId", nf_service_set_cond->nf_service_set_id) == NULL) {
ogs_error("OpenAPI_nf_service_set_cond_convertToJSON() failed [nf_service_set_id]");
goto end;
@ -48,12 +57,13 @@ end:
OpenAPI_nf_service_set_cond_t *OpenAPI_nf_service_set_cond_parseFromJSON(cJSON *nf_service_set_condJSON)
{
OpenAPI_nf_service_set_cond_t *nf_service_set_cond_local_var = NULL;
cJSON *nf_service_set_id = cJSON_GetObjectItemCaseSensitive(nf_service_set_condJSON, "nfServiceSetId");
OpenAPI_lnode_t *node = NULL;
cJSON *nf_service_set_id = NULL;
nf_service_set_id = cJSON_GetObjectItemCaseSensitive(nf_service_set_condJSON, "nfServiceSetId");
if (!nf_service_set_id) {
ogs_error("OpenAPI_nf_service_set_cond_parseFromJSON() failed [nf_service_set_id]");
goto end;
}
if (!cJSON_IsString(nf_service_set_id)) {
ogs_error("OpenAPI_nf_service_set_cond_parseFromJSON() failed [nf_service_set_id]");
goto end;