From c1f04098227c17bbebe286871c75524c80eb8b3a Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Thu, 4 Oct 2018 19:20:30 +0530 Subject: cli : coverity fix in cli-rl.c This patch fixes CID 1395248. Issue : Resource leak updates: bz#789278 Change-Id: I2fd4e36ac2c2a034e56883436abfc5199b095026 Signed-off-by: Sunny Kumar --- cli/src/cli-rl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'cli/src/cli-rl.c') diff --git a/cli/src/cli-rl.c b/cli/src/cli-rl.c index dd0993b8646..7831d0bcb40 100644 --- a/cli/src/cli-rl.c +++ b/cli/src/cli-rl.c @@ -281,11 +281,9 @@ cli_rl_autocomplete_prepare(struct cli_state *state, const char *text) break; } - if (!word) + if (!word || !token) goto out; - if (!token) - return 0; matches = cli_rl_get_matches(state, word, token); state->matches = matches; -- cgit