Re: [libvirt] [PATCH] testutilsqemu: avoid uninitialized variable

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

 



> Gcc on F12 caught this, sorry I didn't catch it in the review:
> 
> > -    if ((machines = testQemuAllocMachines(&nmachines)) == NULL)
> > +    if ((caps->host.cpu = virCPUDefCopy(&host_cpu)) == NULL ||
> > +        (machines = testQemuAllocMachines(&nmachines)) == NULL)
> >          goto cleanup;
> 
> This change meant that we could then use machines inside the
> cleanup: label without having initialized it; freeing uninitialized
> data is never a good idea, even it if is unlikely to have happened.
> 
> I'm pushing it under the obvious rule, since it breaks builds with
> --enable-compiler-warnings=error.

Hmm, my gcc didn't catch it :( I always configure with warnings=error and I
even built from scratch everything just before pushing... Thanks for the fix.

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]