]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
virsh: Call virDomainFree in cmdDomFSTrim
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Apr 2013 15:18:30 +0000 (17:18 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Apr 2013 15:36:06 +0000 (17:36 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=928197

The virsh domfstrim command was not freeing allocated domain,
leaving leaked references behind.

tools/virsh-domain.c

index 5ddcedc89f5a88fc1aefb8b56c2553df5baa8995..92796601a240d05d92db599a85d051335612d33f 100644 (file)
@@ -10040,7 +10040,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"));
@@ -10058,6 +10058,7 @@ cmdDomFSTrim(vshControl *ctl, const vshCmd *cmd)
     ret = true;
 
 cleanup:
+    virDomainFree(dom);
     return ret;
 }