From 039c1e8d4f858661a4211ba16145d6c53c49b8ba Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 11 Apr 2018 14:09:21 -0400 Subject: [PATCH] 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 --- lib/command_match.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/command_match.c b/lib/command_match.c index f6b07a0b20..99ec03e0c2 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -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);