mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
vsh: Drop useless check for cmd != NULL
All our internal *Free() functions are capable of handling NULL. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
8010997e2c
commit
f784403093
@ -1392,10 +1392,8 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser)
|
|||||||
vshCmd *clast = NULL;
|
vshCmd *clast = NULL;
|
||||||
vshCmdOpt *first = NULL;
|
vshCmdOpt *first = NULL;
|
||||||
|
|
||||||
if (ctl->cmd) {
|
|
||||||
vshCommandFree(ctl->cmd);
|
vshCommandFree(ctl->cmd);
|
||||||
ctl->cmd = NULL;
|
ctl->cmd = NULL;
|
||||||
}
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
vshCmdOpt *last = NULL;
|
vshCmdOpt *last = NULL;
|
||||||
@ -1576,10 +1574,8 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
syntaxError:
|
syntaxError:
|
||||||
if (ctl->cmd) {
|
|
||||||
vshCommandFree(ctl->cmd);
|
vshCommandFree(ctl->cmd);
|
||||||
ctl->cmd = NULL;
|
ctl->cmd = NULL;
|
||||||
}
|
|
||||||
vshCommandOptFree(first);
|
vshCommandOptFree(first);
|
||||||
VIR_FREE(tkdata);
|
VIR_FREE(tkdata);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user