From: Michal Privoznik Date: Tue, 2 Apr 2013 15:18:30 +0000 (+0200) Subject: virsh: Call virDomainFree in cmdDomFSTrim X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5fdccc85578e05300a419fa2c87f18ed08f6f220;p=thirdparty%2Flibvirt.git virsh: Call virDomainFree in cmdDomFSTrim 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) --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index d1e6f9dff5..bde6d941db 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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; }