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>
This commit is contained in:
Sunny Kumar 2018-10-04 19:20:30 +05:30 committed by Atin Mukherjee
parent 07cb6a4865
commit c1f0409822

View File

@ -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;