Compiling with -Werror showed a possible use before initialization

in src/qemu_driver.c.  Make sure to initialize the olddisk ptr to NULL.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
This commit is contained in:
Chris Lalancette 2008-10-16 13:44:09 +00:00
parent e4e4a45927
commit 164f786626
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Thu Oct 16 15:41:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
* Compiling with -Werror showed a possible use before initialization
in src/qemu_driver.c. Make sure to initialize the origdisk ptr to
NULL.
Thu Oct 16 15:04:36 +0200 Jim Meyering <meyering@redhat.com> Thu Oct 16 15:04:36 +0200 Jim Meyering <meyering@redhat.com>
build: exempt *.ico files from the trailing blank check build: exempt *.ico files from the trailing blank check

View File

@ -2401,6 +2401,7 @@ static int qemudDomainChangeEjectableMedia(virDomainPtr dom,
return -1; return -1;
} }
origdisk = NULL;
newdisk = dev->data.disk; newdisk = dev->data.disk;
for (i = 0 ; i < vm->def->ndisks ; i++) { for (i = 0 ; i < vm->def->ndisks ; i++) {
if (vm->def->disks[i]->bus == newdisk->bus && if (vm->def->disks[i]->bus == newdisk->bus &&