From c01d03a6587b18722e5a7381084591e01eca64b5 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Tue, 20 Dec 2016 03:12:32 +0000 Subject: bgpd, lib: fix a few scan-build catches Fixes a couple null pointer derefs and uninit'd values. Signed-off-by: Quentin Young --- lib/command_match.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/command_match.c') diff --git a/lib/command_match.c b/lib/command_match.c index 62905a4f7f..d228563240 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -482,7 +482,7 @@ add_nexthops (struct list *list, struct graph_node *node, child = vector_slot (node->to, i); size_t j; struct cmd_token *token = child->data; - if (!token->allowrepeat) + if (!token->allowrepeat && stack) { for (j = 0; j < stackpos; j++) if (child == stack[j]) -- cgit v1.2.3