mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-16 16:54:12 +00:00
bgpd: rfapi xcallocs guaranteed non-null
The return value of XCALLOC will always be non-null. Even if it were to be null, this code would still crash with a NPD. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
039c1e8d4f
commit
316f27e169
@ -548,13 +548,12 @@ rfapi_group_new(struct bgp *bgp, rfapi_group_cfg_type_t type, const char *name)
|
||||
|
||||
rfg = XCALLOC(MTYPE_RFAPI_GROUP_CFG,
|
||||
sizeof(struct rfapi_nve_group_cfg));
|
||||
if (rfg) {
|
||||
rfg->type = type;
|
||||
rfg->name = strdup(name);
|
||||
/* add to tail of list */
|
||||
listnode_add(bgp->rfapi_cfg->nve_groups_sequential, rfg);
|
||||
}
|
||||
rfg->type = type;
|
||||
rfg->name = strdup(name);
|
||||
/* add to tail of list */
|
||||
listnode_add(bgp->rfapi_cfg->nve_groups_sequential, rfg);
|
||||
rfg->label = MPLS_LABEL_NONE;
|
||||
|
||||
QOBJ_REG(rfg, rfapi_nve_group_cfg);
|
||||
|
||||
return rfg;
|
||||
|
Loading…
Reference in New Issue
Block a user