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

[Xen-changelog] [xen-unstable] xl: fix double free of domain names



# HG changeset patch
# User Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
# Date 1284140873 -3600
# Node ID d57c33873eede42abedc6534150ac6f8cb6ca237
# Parent  29e9d0f2a2fd1f0a4f8be0519237a8ed5b4b5bf0
xl: fix double free of domain names

Assigning malloc'd variables from one structure to another when both of
them are free'd via destructors is a bad idea. Let's use a strdup.

Signed-off-by: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 29e9d0f2a2fd -r d57c33873eed tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Fri Sep 10 18:44:09 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Fri Sep 10 18:47:53 2010 +0100
@@ -296,7 +296,7 @@ static void init_dm_info(libxl_device_mo
 
     libxl_uuid_generate(&dm_info->uuid);
 
-    dm_info->dom_name = c_info->name;
+    dm_info->dom_name = strdup(c_info->name);
     dm_info->device_model = strdup("qemu-dm");
     dm_info->videoram = b_info->video_memkb / 1024;
     dm_info->apic = b_info->u.hvm.apic;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.