Error: SIZEOF_MISMATCH:
/builddir/build/BUILD/sblim-gather-2.2.3/plugin/metricVirt.c:298: suspicious_sizeof: Passing argument "sizeof (ids) /*8*/ * node_statistics.num_active_domains" to function "malloc" and then casting the return value to "int *" is suspicious. Did you intend to use "sizeof(*ids)" instead of "sizeof (ids)" ?
Error: NO_EFFECT:
/builddir/build/BUILD/sblim-gather-2.2.3/plugin/metricVirt.c:306: unsigned_compare: This less-than-zero comparison of an unsigned value is never true. "(node_statistics.num_active_domains = virConnectListDomains(conn, ids_ptr, node_statistics.num_active_domains)) < 0U".
/builddir/build/BUILD/sblim-gather-2.2.3/plugin/metricVirt.c:357: unsigned_compare: This less-than-zero comparison of an unsigned value is never true. "(node_statistics.num_inactive_domains = virConnectListDefinedDomains(conn, defdomlist, node_statistics.num_inactive_domains)) < 0U".
The first error overallocates memory.
The second has the side effect that on -1 return from libvirt API the value tested is converted into an unsigned value and the error code path is never taken.
Fixes allocation size and use of unsigned types assigned possible negative values.
Committed to CVS Head.