mirror of https://gitee.com/openkylin/libvirt.git
Add proper OOM reporting for esxDomainGetOSType
* src/esx/esx_driver.c: catch an unchecked strdup in esxDomainGetOSType()
This commit is contained in:
parent
22a5ebe44b
commit
a7c76142a0
|
@ -1395,9 +1395,16 @@ esxDomainDestroy(virDomainPtr domain)
|
||||||
|
|
||||||
|
|
||||||
static char *
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue