diff options
author | Neale Ranns <nranns@cisco.com> | 2018-12-21 07:00:56 -0800 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2018-12-21 15:59:08 +0000 |
commit | b7778b6310b57a13626041ed8613cea37d41c9ca (patch) | |
tree | 226264b28f9adb355eb655271af7b3cc7bda36bd /src/vnet/mfib/mfib_entry.c | |
parent | d2bad81b0ddaa7420b2f767e1a8dc078c0eadbcb (diff) |
MFIB: coverity fixes
Change-Id: I5c1bc498f7299e175070eb288e40f8d037c9be3a
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/mfib/mfib_entry.c')
-rw-r--r-- | src/vnet/mfib/mfib_entry.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/vnet/mfib/mfib_entry.c b/src/vnet/mfib/mfib_entry.c index ac37665fb72..79d2f9a50a3 100644 --- a/src/vnet/mfib/mfib_entry.c +++ b/src/vnet/mfib/mfib_entry.c @@ -633,16 +633,25 @@ mfib_entry_stack (mfib_entry_t *mfib_entry, { /* * for exclusive routes the source provided a replicate DPO - * we we stashed inthe special path list with one path + * which we stashed in the special path list with one path, * so we can stack directly on that. */ ASSERT(1 == vec_len(ctx.next_hops)); - dpo_stack(DPO_MFIB_ENTRY, dp, - &mfib_entry->mfe_rep, - &ctx.next_hops[0].path_dpo); - dpo_reset(&ctx.next_hops[0].path_dpo); - vec_free(ctx.next_hops); + if (NULL != ctx.next_hops) + { + dpo_stack(DPO_MFIB_ENTRY, dp, + &mfib_entry->mfe_rep, + &ctx.next_hops[0].path_dpo); + dpo_reset(&ctx.next_hops[0].path_dpo); + vec_free(ctx.next_hops); + } + else + { + dpo_stack(DPO_MFIB_ENTRY, dp, + &mfib_entry->mfe_rep, + drop_dpo_get(dp)); + } } } else |