[PATCH] virsh-domain: Free dom before return false in cmdDump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




---
 tools/virsh-domain.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 856e888..f6d4edd 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -4487,8 +4487,10 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)
     if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
         return false;
 
-    if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0)
+    if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0) {
+        virDomainFree(dom);
         return false;
+    }
 
     if (vshCommandOptBool(cmd, "verbose"))
         verbose = true;
-- 
1.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]