]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/xm_internal.c: fix a crash on vcpupin to inactive Xen domains,
authorDaniel Veillard <veillard@redhat.com>
Wed, 15 Apr 2009 09:53:34 +0000 (09:53 +0000)
committerDaniel Veillard <veillard@redhat.com>
Wed, 15 Apr 2009 09:53:34 +0000 (09:53 +0000)
  as raised by Takahashi Tomohiro
daniel

ChangeLog
src/xm_internal.c

index e2578a205dd474cf25baa5d799247876796a38b2..f715d50a882fbab09acded3f9e1a7020c8c17962 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Apr 15 11:52:15 CEST 2009 Daniel Veillard <veillard@redhat.com>
+
+       * src/xm_internal.c: fix a crash on vcpupin to inactive Xen domains,
+         as raised by Takahashi Tomohiro
+
 Wed Apr 15 11:33:33 CEST 2009 Daniel Veillard <veillard@redhat.com>
 
        * src/lxc_driver.c: adds the getHostname method to the lxc driver
index 26e8d01bec1ae1692dbedaed5ee6341b0c266e03..09fe24c4bb4b26da19bb290ee6f221772550929f 100644 (file)
@@ -1624,7 +1624,7 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
     const char *filename;
     xenXMConfCachePtr entry;
     virBuffer mapbuf = VIR_BUFFER_INITIALIZER;
-    char *mapstr = NULL;
+    char *mapstr = NULL, *mapsave = NULL;
     int i, j, n, comma = 0;
     int ret = -1;
     char *cpuset = NULL;
@@ -1679,6 +1679,7 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
     }
 
     mapstr = virBufferContentAndReset(&mapbuf);
+    mapsave = mapstr;
 
     if (VIR_ALLOC_N(cpuset, maxcpu) < 0) {
         virReportOOMError(domain->conn);
@@ -1700,7 +1701,7 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
     ret = 0;
 
  cleanup:
-    VIR_FREE(mapstr);
+    VIR_FREE(mapsave);
     VIR_FREE(cpuset);
     xenUnifiedUnlock(priv);
     return (ret);