lib: add asserts on returned matcher vals

These asserts verify that the status correlates with the expected result
and fixes a clang-analyze warning.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
Quentin Young 2018-04-11 14:09:21 -04:00
parent 8934b81c69
commit 039c1e8d4f

View File

@ -99,6 +99,9 @@ enum matcher_rv command_match(struct graph *cmdgraph, vector vline,
struct listnode *head = listhead(*argv);
struct listnode *tail = listtail(*argv);
assert(head);
assert(tail);
// delete dummy start node
cmd_token_del((struct cmd_token *)head->data);
list_delete_node(*argv, head);