From deb86ee9123ef47dce80dd77a9bc583f2b0214db Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 2 Apr 2013 17:18:30 +0200 Subject: [PATCH] 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. --- tools/virsh-domain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5ddcedc89f..92796601a2 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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; } -- GitLab