Add proper OOM reporting for esxDomainGetOSType

* src/esx/esx_driver.c: catch an unchecked strdup in
  esxDomainGetOSType()
This commit is contained in:
Matthias Bolte 2009-08-06 15:07:46 +02:00 committed by Daniel Veillard
parent 22a5ebe44b
commit a7c76142a0

View File

@ -1395,9 +1395,16 @@ esxDomainDestroy(virDomainPtr domain)
static char *
esxDomainGetOSType(virDomainPtr dom ATTRIBUTE_UNUSED)
esxDomainGetOSType(virDomainPtr domain)
{
return strdup("hvm");
char *osType = strdup("hvm");
if (osType == NULL) {
virReportOOMError(domain->conn);
return NULL;
}
return osType;
}