]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: add asserts on returned matcher vals
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 11 Apr 2018 18:09:21 +0000 (14:09 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 13 Apr 2018 21:17:42 +0000 (17:17 -0400)
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>
lib/command_match.c

index f6b07a0b20892d4bac482aa512c20cf109d3729a..99ec03e0c2486d3e4a3f9c1aa03b6a35f7bcbd06 100644 (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);