diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index e0ab70154e3a57f956783a740d08bcf6607f7b5a..aa5bbdb3c73b71760a5f28ff18c6e430a99125a2 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -137,6 +137,9 @@ void RCconfig_flexran()
                 sizeof(flexran_agent_info_t), i + 1, num_enbs);
     /* if config says "yes", enable Agent, in all other cases it's like "no" */
     RC.flexran[i]->enabled          = strcasecmp(*(flexranParams[FLEXRAN_ENABLED].strptr), "yes") == 0;
+    /* if not enabled, simply skip the rest, it is not needed anyway */
+    if (!RC.flexran[i]->enabled)
+      continue;
     RC.flexran[i]->interface_name   = strdup(*(flexranParams[FLEXRAN_INTERFACE_NAME_IDX].strptr));
     //inet_ntop(AF_INET, &(enb_properties->properties[mod_id]->flexran_agent_ipv4_address), in_ip, INET_ADDRSTRLEN);
     RC.flexran[i]->remote_ipv4_addr = strdup(*(flexranParams[FLEXRAN_IPV4_ADDRESS_IDX].strptr));