]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
* src/xml.c: patch from Masayuki Sunou fixing leaks in
authorDaniel Veillard <veillard@redhat.com>
Wed, 11 Jul 2007 08:41:11 +0000 (08:41 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 11 Jul 2007 08:41:11 +0000 (08:41 +0000)
  virDomainParseXMLDiskDesc
Daniel

ChangeLog
NEWS
src/xml.c

index e5e33552a36706ccb8c361febfbb1a76748e6f1e..f295e7e9d7cdd743b39340dae4b0aa5d0e7a5014 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jul 11 10:43:25 CEST 2007 Daniel Veillard <veillard@redhat.com>
+
+       * src/xml.c: patch from Masayuki Sunou fixing leaks in
+         virDomainParseXMLDiskDesc
+
 Mon Jul  9 14:24:12 CEST 2007 Daniel Veillard <veillard@redhat.com>
 
        * configure.in libvirt.spec.in include/libvirt/libvirt.h
diff --git a/NEWS b/NEWS
index 8199375c43bb8a6d2068a984a71075bd7e6fed07..ee5948c9d985c5a704b3b8c499db199c0d252fd7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,48 @@
        http://libvirt.org/news.html
 
 Releases
+0.3.0: Jul 9 2007:
+   - Secure Remote support (Richard Jones).
+      See the remote page
+      of the documentation
+  
+   - Documentation: remote support (Richard Jones), description of
+      the URI connection strings (Richard Jones), update of virsh man
+      page, matrix of libvirt API/hypervisor support with version
+      informations (Richard Jones)
+   - Bug fixes: examples Makefile.am generation (Richard Jones), 
+      SetMem fix (Mark Johnson), URI handling and ordering of 
+      drivers (Daniel Berrange), fix virsh help without hypervisor (Richard
+      Jones), id marshalling fix (Daniel Berrange), fix virConnectGetMaxVcpus
+      on remote (Richard Jones), avoid a realloc leak (Jim Meyering), scheduler
+      parameters handling for Xen (Richard Jones), various early remote
+      bug fixes (Richard Jones), remove virsh leaks of domains references
+      (Masayuki Sunou), configCache refill bug (Richard Jones), fix
+      XML serialization bugs
+   - Improvements: QEmu switch to XDR-based protocol (Dan Berrange),
+      device attach/detach commands (Masayuki Sunou), OCaml bindings
+      (Richard Jones), new entry points virDomainGetConnect and 
+      virNetworkGetConnect useful for bindings (Richard Jones), 
+      reunitifaction of remote and qemu daemon under a single libvirtd
+      with a config file (Daniel Berrange)
+   - Cleanups: parsing of connection URIs (Richard Jones), messages
+      from virsh (Saori Fukuta), Coverage files (Daniel Berrange), 
+      Solaris fixes (Mark Johnson), avoid [r]index calls (Richard Jones),
+      release information in Xen backend, virsh cpupin command cleanups
+      (Masayuki Sunou), xen:/// suppport as standard Xen URI (Richard Jones and
+      Daniel Berrange), improve driver selection/decline mechanism (Richard
+      Jones), error reporting on XML dump (Richard Jones), Remove unused
+      virDomainKernel structure (Richard Jones), daemon event loop event
+      handling (Daniel Berrange), various unifications cleanup in the daemon
+      merging (Daniel Berrange), internal file and timer monitoring API
+      (Daniel Berrange), remove libsysfs dependancy, call brctl program
+      directly (Daniel Berrange), virBuffer functions cleanups (Richard Jones),
+      make init script LSB compliant, error handling on lookup functions
+      (Richard Jones), remove internal virGetDomainByID (Richard Jones),
+      revamp of xen subdrivers interfaces (Richard Jones)
+   - Localization updates
+
+
 0.2.3: Jun 8 2007:
    - Documentation: documentation for upcoming remote access (Richard Jones),
       virConnectNumOfDefinedDomains doc (Jan Michael), virsh help messages
index 52c186788cd8491db7db0ab0facfd6678ba45104..7c2f16bd52a933bb4c5881e1a9f5438f2680f30a 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -719,6 +719,7 @@ virDomainParseXMLDiskDesc(virConnectPtr conn, xmlNodePtr node, virBufferPtr buf,
     int typ = 0;
     int cdrom = 0;
     int isNoSrcCdrom = 0;
+    int ret = 0;
 
     type = xmlGetProp(node, BAD_CAST "type");
     if (type != NULL) {
@@ -768,21 +769,14 @@ virDomainParseXMLDiskDesc(virConnectPtr conn, xmlNodePtr node, virBufferPtr buf,
         }
         if (!isNoSrcCdrom) {
             virXMLError(conn, VIR_ERR_NO_SOURCE, (const char *) target, 0);
-
-            if (target != NULL)
-                xmlFree(target);
-            if (device != NULL)
-                xmlFree(device);
-            return (-1);
+            ret = -1;
+            goto cleanup;
         }
     }
     if (target == NULL) {
         virXMLError(conn, VIR_ERR_NO_TARGET, (const char *) source, 0);
-        if (source != NULL)
-            xmlFree(source);
-        if (device != NULL)
-            xmlFree(device);
-        return (-1);
+        ret = -1;
+        goto cleanup;
     }
 
     /* Xend (all versions) put the floppy device config
@@ -861,12 +855,17 @@ virDomainParseXMLDiskDesc(virConnectPtr conn, xmlNodePtr node, virBufferPtr buf,
     virBufferAdd(buf, ")", 1);
 
  cleanup:
-    xmlFree(drvType);
-    xmlFree(drvName);
-    xmlFree(device);
-    xmlFree(target);
-    xmlFree(source);
-    return (0);
+    if(drvType)
+        xmlFree(drvType);
+    if(drvName)
+        xmlFree(drvName);
+    if(device)
+        xmlFree(device);
+    if(target)
+        xmlFree(target);
+    if(source)
+        xmlFree(source);
+    return (ret);
 }
 
 /**