From a31ff449a002805a67e1efd2c5a03737a3fa7d72 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 8 Feb 2017 15:14:23 +0100 Subject: lib: fix some coverity NULL check warnings Reported-by: Coverity Scan Signed-off-by: David Lamparter --- lib/command.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index cd8f6463e2..6467fb7185 100644 --- a/lib/command.c +++ b/lib/command.c @@ -699,6 +699,8 @@ cmd_complete_command (vector vline, struct vty *vty, int *status) vector_free (comps); comps = NULL; } + else if (initial_comps) + vector_free (initial_comps); // comps should always be null here assert (!comps); @@ -784,6 +786,8 @@ cmd_execute_command_real (vector vline, // if matcher error, return corresponding CMD_ERR if (MATCHER_ERROR(status)) { + if (argv_list) + list_delete (argv_list); switch (status) { case MATCHER_INCOMPLETE: -- cgit v1.2.3