]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
* src/virsh.c src/xen_internal.c src/xend_internal.c: memory leaks
authorDaniel Veillard <veillard@redhat.com>
Tue, 29 May 2007 13:55:19 +0000 (13:55 +0000)
committerDaniel Veillard <veillard@redhat.com>
Tue, 29 May 2007 13:55:19 +0000 (13:55 +0000)
  fixed by a patch from Masayuki Sunou
Daniel

ChangeLog
src/virsh.c
src/xen_internal.c
src/xend_internal.c

index af5615f4060898e08aadc896a011cd904e3a119d..ba95e9b10d55ead6646f2cff1aca174058037e02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue May 29 15:54:17 CEST 2007 Daniel Veillard <veillard@redhat.com>
+
+       * src/virsh.c src/xen_internal.c src/xend_internal.c: memory leaks
+         fixed by a patch from Masayuki Sunou
+
 Wed May 23 16:07:00 BST 2007 Richard W.M. Jones  <rjones@redhat.com>
 
        * src/virsh.c: Add attach-device and detach-device commands to
index 3986e6fb8cce6a1ed97cd0388844b2d022ecf057..5725b502e40101b89558f71060990b92d866e572 100644 (file)
@@ -3153,8 +3153,10 @@ vshCommandParse(vshControl * ctl, char *cmdstr)
             c->def = cmd;
             c->next = NULL;
 
-            if (!vshCommandCheckOpts(ctl, c))
+            if (!vshCommandCheckOpts(ctl, c)) {
+                if(c) free(c);
                 goto syntaxError;
+            }
 
             if (!ctl->cmd)
                 ctl->cmd = c;
index fe6aeff526b27a9b1c43de1bb9da043941db433c..b2ce2bf9ab9c0de1601f10dc50f80aeb5bf0e85a 100644 (file)
@@ -1497,11 +1497,15 @@ xenHypervisorInit(void)
     virXenError(VIR_ERR_XEN_CALL, " ioctl ", IOCTL_PRIVCMD_HYPERCALL);
     close(fd);
     in_init = 0;
+    if (ipt)
+        free(ipt);
     return(-1);
 
  done:
     close(fd);
     in_init = 0;
+    if (ipt)
+        free(ipt);
     return(0);
 }
 
index 136b535de70f27603049bd63521d800117d3184a..2e35e08842029523ae826643a008c3ccbc81b05a 100644 (file)
@@ -3072,7 +3072,7 @@ xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc,
 static int
 xenDaemonAttachDevice(virDomainPtr domain, char *xml)
 {
-    char *sexpr, *conf;
+    char *sexpr, *conf, *str;
     int hvm = 0, ret;
     xenUnifiedPrivatePtr priv;
 
@@ -3084,8 +3084,11 @@ xenDaemonAttachDevice(virDomainPtr domain, char *xml)
 
     priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
 
-    if (strcmp(virDomainGetOSType(domain), "linux"))
+    str = virDomainGetOSType(domain);
+    if (strcmp(str, "linux"))
         hvm = 1;
+    if (str)
+        free(str);
     sexpr = virParseXMLDevice(domain->conn, xml, hvm, priv->xendConfigVersion);
     if (sexpr == NULL)
         return (-1);