]> xenbits.xensource.com Git - libvirt.git/commit
linuxNodeInfoCPUPopulate: avoid used-uninitialized via a test
authorJim Meyering <meyering@redhat.com>
Tue, 18 May 2010 09:58:32 +0000 (11:58 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 18 May 2010 17:23:32 +0000 (19:23 +0200)
commit43beb82ecaef397c820933480f6cc5af155a4d4d
treef1dbf493a268d3a2f7b45188d98d57cccc3ec214
parent4d2adaa1d51981b219505dfd31c0d5f912f90d08
linuxNodeInfoCPUPopulate: avoid used-uninitialized via a test

* tests/nodeinfotest.c (linuxTestCompareFiles): Don't use
nodeinfo->member uninitialized.  linuxNodeInfoCPUPopulate requires
that some of its nodeinfo members (including threads) be initialized
upon input.  The nodeinfotest.c program lacked the initialization,
while the only other use (nodeGetInfo) did perform it.
It's not trivial to move the initialization into the function,
since nodeGetInfo sets at least one member after clearing the
buffer but before calling linuxNodeInfoCPUPopulate.
tests/nodeinfotest.c