]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vsh: fix memory leak in vshCommandParse
authorJán Tomko <jtomko@redhat.com>
Tue, 6 Apr 2021 12:23:31 +0000 (14:23 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 9 Apr 2021 11:07:30 +0000 (13:07 +0200)
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>
tools/vsh.c

index 552ed29ab95cb25d9045cd66b5394c911cd8cb9b..d9c0a9b80d6880d809c0c3629af6feda1935b2d5 100644 (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;
             }