From 4b3b6b1e5e505495ad7631cc32c40be0c8fdeeb2 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Fri, 19 Jan 2024 16:37:42 +0100 Subject: [PATCH] createDRBlist(): return NULL if no active DRB If there are no active bearers, the function previously returned an empty list. Return NULL if there are no bearers, so it is safe to call this function even when no bearers are present. We can also pass it every time to do_RRCReconfiguration(), which will not add an empty list for DRBs. --- openair2/RRC/NR/rrc_gNB.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB.c b/openair2/RRC/NR/rrc_gNB.c index 46db206991..25c131e4aa 100644 --- a/openair2/RRC/NR/rrc_gNB.c +++ b/openair2/RRC/NR/rrc_gNB.c @@ -429,6 +429,10 @@ static NR_DRB_ToAddModList_t *createDRBlist(gNB_RRC_UE_t *ue, bool reestablish) asn1cSeqAdd(&DRB_configList->list, DRB_config); } } + if (DRB_configList->list.count == 0) { + free(DRB_configList); + return NULL; + } return DRB_configList; }