diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c
index a6865bdeddb3f848ca5d388cd3e2d15113898be0..8092c3390c9c91b2f0624731803945b8e0ed05ae 100644
--- a/openair2/RRC/LTE/rrc_eNB.c
+++ b/openair2/RRC/LTE/rrc_eNB.c
@@ -3927,6 +3927,19 @@ flexran_rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt
     }
     free(quantityConfig);
   }
+
+  if(mac_MainConfig){
+      if(mac_MainConfig->ul_SCH_Config){
+          free(mac_MainConfig->ul_SCH_Config);
+          mac_MainConfig->ul_SCH_Config = NULL;
+      }
+      if(mac_MainConfig->phr_Config){
+          free(mac_MainConfig->phr_Config);
+          mac_MainConfig->phr_Config = NULL;
+      }
+      free(mac_MainConfig);
+      mac_MainConfig = NULL;
+  }
 }