if (virFileReadAll(CPUINFO, CPUINFO_FILE_LEN, &outbuf) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to open %s"), CPUINFO);
- return NULL;
+ goto no_memory;
}
ret->nprocessor = 0;
if (virSysinfoParsePPCSystem(outbuf, &ret->system) < 0)
goto no_memory;
+ VIR_FREE(outbuf);
return ret;
no_memory:
VIR_FREE(outbuf);
+ virSysinfoDefFree(ret);
return NULL;
}
if (virFileReadAll(CPUINFO, CPUINFO_FILE_LEN, &outbuf) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to open %s"), CPUINFO);
- return NULL;
+ goto no_memory;
}
ret->nprocessor = 0;
if (virSysinfoParseARMSystem(outbuf, &ret->system) < 0)
goto no_memory;
+ VIR_FREE(outbuf);
return ret;
no_memory:
VIR_FREE(outbuf);
+ virSysinfoDefFree(ret);
return NULL;
}
if (virFileReadAll(CPUINFO, CPUINFO_FILE_LEN, &outbuf) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to open %s"), CPUINFO);
- return NULL;
+ goto no_memory;
}
ret->nprocessor = 0;
if (virFileReadAll(SYSINFO, 8192, &outbuf) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to open %s"), SYSINFO);
- return NULL;
+ goto no_memory;
}
if (virSysinfoParseS390System(outbuf, &ret->system) < 0)
goto no_memory;
+ VIR_FREE(outbuf);
return ret;
no_memory: