zebra: Add NULL check before nhg_connected insert

Add a check to make sure we allocated the nhg_connected
before inserting into the RB tree.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
This commit is contained in:
Stephen Worley 2019-05-14 14:36:48 -07:00
parent 085304dc09
commit 18cf7f15d6

View File

@ -122,7 +122,8 @@ void nhg_connected_head_add(struct nhg_connected_head *head,
new = nhg_connected_new(depend);
RB_INSERT(nhg_connected_head, head, new);
if (new)
RB_INSERT(nhg_connected_head, head, new);
}
unsigned int zebra_nhg_depends_count(const struct nhg_hash_entry *nhe)