Bugfix: set pointer to NULL after free

This commit is contained in:
Robert Schmidt
2023-11-30 15:45:45 +01:00
parent 463dfc6658
commit 72b485a2fe
+2 -2
View File
@@ -689,8 +689,8 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(instance_t instance,
switch (bcch_message->message.choice.c1->present) {
case NR_BCCH_DL_SCH_MessageType__c1_PR_systemInformationBlockType1:
LOG_D(NR_RRC, "[UE %ld] Decoding SIB1\n", instance);
if(SI_info->sib1)
ASN_STRUCT_FREE(asn_DEF_NR_SIB1, SI_info->sib1);
ASN_STRUCT_FREE(asn_DEF_NR_SIB1, SI_info->sib1);
SI_info->sib1 = NULL;
NR_SIB1_t *sib1 = bcch_message->message.choice.c1->choice.systemInformationBlockType1;
if(!SI_info->sib1)
SI_info->sib1 = calloc(1, sizeof(*SI_info->sib1));