]> xenbits.xensource.com Git - libvirt.git/commitdiff
virsh: Fix resource leak while listing inactive domains with titles
authorPeter Krempa <pkrempa@redhat.com>
Mon, 6 Feb 2012 14:25:05 +0000 (15:25 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 6 Feb 2012 14:25:05 +0000 (15:25 +0100)
Commit fad5cd210899dfde4afe36712754dc921c3f3051 introduces a new flag
that allows to show domain's title with domains. This commit introduced
resource leak while listing inactive domains with titles.

tools/virsh.c

index 1613d2ebf26b86e6376951ebe12dc22a820cac28..d6fe680baf9cfa5705659e5275b45519a489ec07 100644 (file)
@@ -1012,10 +1012,10 @@ cmdList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
                      "-",
                      names[i],
                      state == -2 ? _("saved") : _(vshDomainStateToString(state)));
+        }
 
         virDomainFree(dom);
         VIR_FREE(names[i]);
-        }
     }
 
     ret = true;