diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c index 4822c799ee..86f12d126a 100644 --- a/openair2/GNB_APP/gnb_config.c +++ b/openair2/GNB_APP/gnb_config.c @@ -348,13 +348,14 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) { } // fix SS0 and Coreset0 - if((int)*scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero == -1) { - free(scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero); - scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero = NULL; + NR_PDCCH_ConfigCommon_t *pdcch_cc = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup; + if((int)*pdcch_cc->searchSpaceZero == -1) { + free(pdcch_cc->searchSpaceZero); + pdcch_cc->searchSpaceZero = NULL; } - if((int)*scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero == -1) { - free(scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero); - scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero = NULL; + if((int)*pdcch_cc->controlResourceSetZero == -1) { + free(pdcch_cc->controlResourceSetZero); + pdcch_cc->controlResourceSetZero = NULL; } // fix UL absolute frequency diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 54edbaa214..3616f20242 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -241,12 +241,10 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) { * The SIB1 will be sent in this allocation (Type0-PDCCH) : 38.213, 13-4 Table and 38.213 13-11 to 13-14 tables * the reverse allocation is in nr_ue_decode_mib() */ - long cset0 = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero ? - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero : 0; - long ss0 = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero ? - *scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero : 0; - + const NR_PDCCH_ConfigCommon_t *pdcch_cc = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup; + long cset0 = pdcch_cc->controlResourceSetZero ? *pdcch_cc->controlResourceSetZero : 0; mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero = cset0; + long ss0 = pdcch_cc->searchSpaceZero ? *pdcch_cc->searchSpaceZero : 0; mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero = ss0; switch (*scc->ssbSubcarrierSpacing) {