Use automatic memory freeing for the temporary bitmap and remove the
pointless 'cleanup' section.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
static unsigned long
virHostCPUCountThreadSiblings(unsigned int cpu)
{
- virBitmap *siblings_map;
- unsigned long ret = 0;
+ g_autoptr(virBitmap) siblings_map = NULL;
if (!(siblings_map = virHostCPUGetSiblingsList(cpu)))
- goto cleanup;
-
- ret = virBitmapCountBits(siblings_map);
+ return 0;
- cleanup:
- virBitmapFree(siblings_map);
- return ret;
+ return virBitmapCountBits(siblings_map);
}
/* parses a node entry, returning number of processors in the node and