cli : fix few coverity in cli

This patch fixes DEADCODE and FORWARD_NULL.

CID : 1124495, 1124380, 1124381

Change-Id: I79992e396dbcb1bfe6cd0614d49a8da3f67d648d
updates: bz#789278
Signed-off-by: Sunny Kumar <sunkumar@redhat.com>
This commit is contained in:
Sunny Kumar 2018-08-10 00:57:09 +05:30 committed by Shyamsundar Ranganathan
parent 3cb5b63a0a
commit 5acb74d7da
2 changed files with 6 additions and 4 deletions

@ -295,6 +295,8 @@ cli_rl_autocomplete_prepare (struct cli_state *state, const char *text)
if (!word)
goto out;
if (!tokens)
return 0;
matches = cli_rl_get_matches (state, word, token);
state->matches = matches;

@ -2411,10 +2411,10 @@ cli_xml_output_vol_info_option (xmlTextWriterPtr writer, char *substr,
break;
ptr1++;
ptr2++;
if (!ptr1)
goto out;
if (!ptr2)
goto out;
if (!*ptr1)
break;
if (!*ptr2)
break;
}
if (*ptr2 == '\0')
goto out;