diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index c2254ae791e9..ba0a62185103 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -3403,7 +3403,8 @@ static struct bgp *bgp_create(as_t *as, const char *name, if (hidden) { bgp = bgp_old; - goto peer_init; + } else { + bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp)); } bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp)); @@ -3413,6 +3414,10 @@ static struct bgp *bgp_create(as_t *as, const char *name, else bgp->as_pretty = XSTRDUP(MTYPE_BGP_NAME, asn_asn2asplain(*as)); + if (hidden) { + goto peer_init; + } + if (asnotation != ASNOTATION_UNDEFINED) { bgp->asnotation = asnotation; SET_FLAG(bgp->config, BGP_CONFIG_ASNOTATION);