mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-29 17:36:56 +00:00
*: Do not check for XMALLOC/XCALLOC against NULLs
We don't check this pattern anywhere in the code basically, so let's unify the code. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
63f7a3b910
commit
e702605d80
@ -651,8 +651,6 @@ static struct bfd_dplane_ctx *bfd_dplane_ctx_new(int sock)
|
||||
struct bfd_dplane_ctx *bdc;
|
||||
|
||||
bdc = XCALLOC(MTYPE_BFDD_DPLANE_CTX, sizeof(*bdc));
|
||||
if (bdc == NULL)
|
||||
return NULL;
|
||||
|
||||
bdc->sock = sock;
|
||||
bdc->inbuf = stream_new(BFD_DPLANE_CLIENT_BUF_SIZE);
|
||||
|
@ -3104,8 +3104,6 @@ static struct bgp *bgp_create(as_t *as, const char *name,
|
||||
safi_t safi;
|
||||
|
||||
bgp = XCALLOC(MTYPE_BGP, sizeof(struct bgp));
|
||||
if (bgp == NULL)
|
||||
return NULL;
|
||||
|
||||
if (BGP_DEBUG(zebra, ZEBRA)) {
|
||||
if (inst_type == BGP_INSTANCE_TYPE_DEFAULT)
|
||||
|
@ -538,8 +538,6 @@ struct ls_edge *ls_edge_add(struct ls_ted *ted,
|
||||
|
||||
/* Create Edge and add it to the TED */
|
||||
new = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_edge));
|
||||
if (!new)
|
||||
return NULL;
|
||||
|
||||
new->attributes = attributes;
|
||||
new->key = key;
|
||||
@ -804,8 +802,6 @@ struct ls_ted *ls_ted_new(const uint32_t key, const char *name,
|
||||
struct ls_ted *new;
|
||||
|
||||
new = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_ted));
|
||||
if (new == NULL)
|
||||
return new;
|
||||
|
||||
/* Set basic information for this ted */
|
||||
new->key = key;
|
||||
@ -1005,8 +1001,6 @@ static struct ls_node *ls_parse_node(struct stream *s)
|
||||
size_t len;
|
||||
|
||||
node = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_node));
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
STREAM_GET(&node->adv, s, sizeof(struct ls_node_id));
|
||||
STREAM_GETW(s, node->flags);
|
||||
@ -1051,8 +1045,6 @@ static struct ls_attributes *ls_parse_attributes(struct stream *s)
|
||||
size_t len;
|
||||
|
||||
attr = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_attributes));
|
||||
if (attr == NULL)
|
||||
return NULL;
|
||||
attr->srlgs = NULL;
|
||||
|
||||
STREAM_GET(&attr->adv, s, sizeof(struct ls_node_id));
|
||||
@ -1157,8 +1149,6 @@ static struct ls_prefix *ls_parse_prefix(struct stream *s)
|
||||
size_t len;
|
||||
|
||||
ls_pref = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_prefix));
|
||||
if (ls_pref == NULL)
|
||||
return NULL;
|
||||
|
||||
STREAM_GET(&ls_pref->adv, s, sizeof(struct ls_node_id));
|
||||
STREAM_GETW(s, ls_pref->flags);
|
||||
@ -1193,8 +1183,6 @@ struct ls_message *ls_parse_msg(struct stream *s)
|
||||
struct ls_message *msg;
|
||||
|
||||
msg = XCALLOC(MTYPE_LS_DB, sizeof(struct ls_message));
|
||||
if (msg == NULL)
|
||||
return NULL;
|
||||
|
||||
/* Read LS Message header */
|
||||
STREAM_GETC(s, msg->event);
|
||||
|
Loading…
Reference in New Issue
Block a user