diff --git a/src/nrf/nnrf-handler.c b/src/nrf/nnrf-handler.c index 27fe4f5a9..5b50ee5a7 100644 --- a/src/nrf/nnrf-handler.c +++ b/src/nrf/nnrf-handler.c @@ -40,6 +40,33 @@ bool nrf_nnrf_handle_nf_register(ogs_sbi_nf_instance_t *nf_instance, return false; } + if (!NFProfile->nf_instance_id) { + ogs_error("No NFProfile.NFInstanceId"); + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No NFProfile.NFInstanceId", NULL)); + return false; + } + + if (!NFProfile->nf_type) { + ogs_error("No NFProfile.NFType"); + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No NFProfile.NFType", NULL)); + return false; + } + + if (!NFProfile->nf_status) { + ogs_error("No NFProfile.NFStatus"); + ogs_assert(true == + ogs_sbi_server_send_error( + stream, OGS_SBI_HTTP_STATUS_BAD_REQUEST, + recvmsg, "No NFProfile.NFStatus", NULL)); + return false; + } + ogs_nnrf_nfm_handle_nf_profile(nf_instance, NFProfile); if (OGS_FSM_CHECK(&nf_instance->sm, nrf_nf_state_will_register)) { diff --git a/src/nrf/nrf-sm.c b/src/nrf/nrf-sm.c index 0b491ec43..0b1e4b55d 100644 --- a/src/nrf/nrf-sm.c +++ b/src/nrf/nrf-sm.c @@ -164,7 +164,6 @@ void nrf_state_operational(ogs_fsm_t *s, nrf_event_t *e) nrf_nf_state_exception)) { ogs_error("[%s] State machine exception", nf_instance->id); - ogs_sbi_message_free(&message); nrf_nf_fsm_fini(nf_instance); ogs_sbi_nf_instance_remove(nf_instance);