summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rl.c
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2018-10-04 19:20:30 +0530
committerAtin Mukherjee <amukherj@redhat.com>2018-10-05 05:07:18 +0000
commitc1f04098227c17bbebe286871c75524c80eb8b3a (patch)
tree303b461493b51555f2a57a350821af96e9bc7697 /cli/src/cli-rl.c
parent07cb6a486502fa0f7ea141e7600ec67015383546 (diff)
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 <sunkumar@redhat.com>
Diffstat (limited to 'cli/src/cli-rl.c')
-rw-r--r--cli/src/cli-rl.c4
1 files changed, 1 insertions, 3 deletions
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;