Coverity found that commit id '
c661b675f' needed to create a cleanup
path to handle the closing of 'fp' if the virBitmapNewQuiet failed.
virBitmapPtr virHostValidateGetCPUFlags(void)
{
FILE *fp;
- virBitmapPtr flags;
+ virBitmapPtr flags = NULL;
if (!(fp = fopen("/proc/cpuinfo", "r")))
return NULL;
if (!(flags = virBitmapNewQuiet(VIR_HOST_VALIDATE_CPU_FLAG_LAST)))
- return NULL;
+ goto cleanup;
do {
char line[1024];
virStringFreeListCount(tokens, ntokens);
} while (1);
+ cleanup:
VIR_FORCE_FCLOSE(fp);
return flags;