There exists a call path where the nhlfe_alloc can return NULL
for blackhole nexthops. In this case we were still trying
to save the nhlfe pointer causing a crash when we attempted
to add it to a self-contained list.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
nhlfe = nhlfe_alloc(lsp, lsp_type, gtype, gate, ifindex, num_labels,
labels);
+ if (!nhlfe)
+ return NULL;
+
/* Enqueue to LSP: primaries at head of list, backups at tail */
if (is_backup) {
SET_FLAG(nhlfe->flags, NHLFE_FLAG_IS_BACKUP);