]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: Call virDomainFree in cmdDomFSTrim
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Apr 2013 15:18:30 +0000 (17:18 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 9 Apr 2013 19:47:24 +0000 (13:47 -0600)
https://bugzilla.redhat.com/show_bug.cgi?id=928197

The virsh domfstrim command was not freeing allocated domain,
leaving leaked references behind.
(cherry picked from commit deb86ee9123ef47dce80dd77a9bc583f2b0214db)

tools/virsh-domain.c

index d1e6f9dff53f0914732156ae912e6253e24618de..bde6d941dbc15ec292b2923af6be90bb7a360b20 100644 (file)
@@ -10094,7 +10094,7 @@ cmdDomFSTrim(vshControl *ctl, const vshCmd *cmd)
     unsigned int flags = 0;
 
     if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
-        goto cleanup;
+        return ret;
 
     if (vshCommandOptULongLong(cmd, "minimum", &minimum) < 0) {
         vshError(ctl, _("Unable to parse integer parameter minimum"));
@@ -10112,6 +10112,7 @@ cmdDomFSTrim(vshControl *ctl, const vshCmd *cmd)
     ret = true;
 
 cleanup:
+    virDomainFree(dom);
     return ret;
 }