From 3c94b9a18f298ead25ae8b8b99ed104d57ffbda3 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 26 Nov 2024 11:57:00 +0100 Subject: [PATCH] rrc_gNB_du.c: avoid potential double-free Set pointer to NULL when freeing to avoid potential double frees. --- openair2/RRC/NR/rrc_gNB_du.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR/rrc_gNB_du.c b/openair2/RRC/NR/rrc_gNB_du.c index bc3c564516..4f563d8c43 100644 --- a/openair2/RRC/NR/rrc_gNB_du.c +++ b/openair2/RRC/NR/rrc_gNB_du.c @@ -505,8 +505,10 @@ void rrc_gNB_process_f1_du_configuration_update(f1ap_gnb_du_configuration_update // MIB is mandatory, so will be overwritten. SIB1 is optional, so will // only be overwritten if present in sys_info ASN_STRUCT_FREE(asn_DEF_NR_MIB, du->mib); - if (sys_info->sib1 != NULL) + if (sys_info->sib1 != NULL) { ASN_STRUCT_FREE(asn_DEF_NR_SIB1, du->sib1); + du->sib1 = NULL; + } NR_MIB_t *mib = NULL; if (!extract_sys_info(sys_info, &mib, &du->sib1)) {