From: Daniel Veillard Date: Wed, 3 Sep 2008 12:52:27 +0000 (+0000) Subject: avoid a segfault on CD eject in KVM/QEmu X-Git-Tag: LIBVIRT_0_4_6~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53738f83a5cc399804432dad5e138124eb7e6884;p=thirdparty%2Flibvirt.git avoid a segfault on CD eject in KVM/QEmu * src/qemu_driver.c: patch from Cole Robinson to avoid a segfault on KVM CD eject Daniel --- diff --git a/ChangeLog b/ChangeLog index f504f0750f..6570f8886e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Sep 3 14:51:03 CEST 2008 Daniel Veillard + + * src/qemu_driver.c: patch from Cole Robinson to avoid a segfault + on KVM CD eject + Wed Sep 3 14:37:06 CEST 2008 Daniel Veillard * src/virsh.c: patch from Cole Robinson to add output on attach diff --git a/src/qemu_driver.c b/src/qemu_driver.c index eb4454a5a5..f71b6e8569 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -2974,7 +2974,10 @@ static int qemudDomainChangeCDROM(virDomainPtr dom, } VIR_FREE(reply); VIR_FREE(cmd); - strcpy(olddisk->src, newdisk->src); + + VIR_FREE(olddisk->src); + olddisk->src = newdisk->src; + newdisk->src = NULL; olddisk->type = newdisk->type; return 0; }