+/*******************************************************************
+ *
+ * @brief Deallocating memory allocated for Served_Cells_To_Modify_Item_t
+ *
+ * @details
+ *
+ * Function : freeCellsToModifyItem
+ *
+ * Functionality: Deallocating memory of variables allocated in
+ * BuildAndSendDUConfigUpdate function
+ *
+ * @params[in] Served_Cells_To_Modify_Item_t *modifyItem
+ *
+ * @return ROK - void
+ *
+ * ****************************************************************/
+
+void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem)
+{
+ uint8_t arrIdx=0,i=0;
+ if(modifyItem->oldNRCGI.pLMN_Identity.buf != NULLP)
+ {
+ if(modifyItem->oldNRCGI.nRCellIdentity.buf != NULLP)
+ {
+ if(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf != NULLP)
+ {
+ if(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf
+ != NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.array\
+ != NULLP)
+ {
+ if(!modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx])
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->pLMN_Identity.buf != NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions!= NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions->list.array != NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions->list.array[arrIdx])
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+ list.array !=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[arrIdx]!=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[arrIdx]->sNSSAI.sST.buf!=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+ SliceSupportList.\
+ list.array[arrIdx]->sNSSAI.sD != NULLP)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.\
+ choice.SliceSupportList.\
+ list.array[arrIdx]->sNSSAI.sD->buf!=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD
+ !=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+ fDD->uL_NRFreqInfo.freqBandListNr.list.array!=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+ fDD->uL_NRFreqInfo.freqBandListNr.list.array[arrIdx]!=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+ fDD->dL_NRFreqInfo.freqBandListNr.list.array !=NULLP)
+ {
+ if(modifyItem->served_Cell_Information.nR_Mode_Info.\
+ choice.fDD->dL_NRFreqInfo.freqBandListNr.list.\
+ array[arrIdx]!= NULLP)
+ {
+ if(modifyItem->served_Cell_Information.\
+ measurementTimingConfiguration.buf !=NULLP)
+ {
+ DU_FREE(modifyItem->served_Cell_Information.\
+ measurementTimingConfiguration.\
+ buf,modifyItem->served_Cell_Information.\
+ measurementTimingConfiguration.size);
+ }
+ DU_FREE(modifyItem->served_Cell_Information.\
+ nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
+ freqBandListNr.\
+ list.array[arrIdx],sizeof(FreqBandNrItem_t));
+ }
+ DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info\
+ .choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
+ modifyItem->served_Cell_Information.nR_Mode_Info.\
+ choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
+ }
+ DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
+ choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
+ array[arrIdx],sizeof(FreqBandNrItem_t));
+ }
+ DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
+ choice.\
+ fDD->uL_NRFreqInfo.freqBandListNr.list.\
+ array,modifyItem->served_Cell_Information.nR_Mode_Info.\
+ choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size);
+ }
+ DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
+ fDD,sizeof(FDD_Info_t));
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions->list.array[arrIdx]->extensionValue.\
+ choice.SliceSupportList.\
+ list.array[arrIdx]->sNSSAI.sD->buf,modifyItem->\
+ served_Cell_Information.\
+ servedPLMNs.list.array[arrIdx]->iE_Extensions->list.\
+ array[arrIdx]->\
+ extensionValue.choice.SliceSupportList.list.array[arrIdx]->\
+ sNSSAI.sD->size);
+
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+ SliceSupportList.\
+ list.array[arrIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+ SliceSupportList.\
+ list.array[arrIdx]->sNSSAI.sST.buf,modifyItem->served_Cell_Information.\
+ servedPLMNs.\
+ list.array[arrIdx]->iE_Extensions->list.array[arrIdx]->\
+ extensionValue.choice.\
+ SliceSupportList.list.array[arrIdx]->sNSSAI.sST.size);
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+ list.array[arrIdx],sizeof(SliceSupportItem_t));
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+ list.array,\
+ modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
+ iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
+ SliceSupportList.list.size);
+ }
+ }
+ for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions->list.count;i++)
+ {
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions->list.array[i],\
+ sizeof(ServedPLMNs_ItemExtIEs_t ));
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions->list.array,modifyItem->served_Cell_Information.\
+ servedPLMNs.list.array[arrIdx]->iE_Extensions->list.size);
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
+ array[arrIdx]->pLMN_Identity.buf,
+ modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->pLMN_Identity.size);
+ }
+ }
+ for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
+ {
+ if(modifyItem->served_Cell_Information.servedPLMNs.list.array[i]
+ != NULLP)
+ {
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i],\
+ sizeof(ServedPLMNs_Item_t));
+ }
+ }
+ DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
+ modifyItem->served_Cell_Information.servedPLMNs.list.size);
+ }
+ DU_FREE(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
+ modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);
+ }
+ DU_FREE(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
+ modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
+ }
+ DU_FREE(modifyItem->oldNRCGI.nRCellIdentity.buf,\
+ modifyItem->oldNRCGI.nRCellIdentity.size);
+ }
+ DU_FREE(modifyItem->oldNRCGI.pLMN_Identity.buf,\
+ modifyItem->oldNRCGI.pLMN_Identity.size);
+ }
+}