vsh: fix memory leak in vshCommandParse

One of the error branches used a plain free where vshCommandFree
was required.

https://bugzilla.redhat.com/show_bug.cgi?id=1943415

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Ján Tomko 2021-04-06 14:23:31 +02:00
parent afda589d05
commit a131b8b517

View File

@ -1530,7 +1530,7 @@ vshCommandParse(vshControl *ctl, vshCommandParser *parser, vshCmd **partial)
if (!partial &&
vshCommandCheckOpts(ctl, c, opts_required, opts_seen) < 0) {
VIR_FREE(c);
vshCommandFree(c);
goto syntaxError;
}