[libvirt] [PATCH] uml_conf.c: don't return an uninitialized pointer

Jim Meyering jim at meyering.net
Thu Sep 3 10:52:43 UTC 2009


Daniel P. Berrange wrote:
...
>> Actually I did that first, but then un-did it in favor
>> of the change above.  Why?  because that initialization could
>> mask a failure to initialize in a new case.
>>
>> With per-case initialization, we'd detect the bug at
>> compile/static-analysis time.  With the up-front unconditional
>> initialization, we cannot, and would have to rely on testing to find it.
>
> It is a tradeoff, but I still prefer the initialization at time of
> declaration as a safety net, and we do use this pattern pretty much
> everywhere

Ok.  adjusted




More information about the libvir-list mailing list