Re: [PATCH] qemu: Resolve Coverity UNINIT

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

 




On 08/15/2015 10:54 AM, Martin Kletzander wrote:
> On Sat, Aug 15, 2015 at 09:18:14AM -0400, John Ferlan wrote:
>> Coverity complained that 'vm' wasn't initialized before jumping to
>> cleanup: and calling virDomainObjEndAPI if the VIR_STRDUP fails.
>> Rather than initialize vm = NULL, I moved the VIR_STRDUP closer to
>> usage and used endjob for goto.
>>
> 
> Wild pointers should not exist.  At all.  It's very subjective, but I
> just don't like them.  ACK if you also initialize that pointer to
> NULL; that won't hurt anyone and will avoid possible future problems.
> 
I agree in general - although in qemu_driver.c - it's hit or miss
whether 'vm' is initialized to NULL. I just flipped a coin and it landed
on moving the code instead of initializing the pointer ;-)

In any case added the = NULL; and pushed.

John

--
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]