mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-24 14:45:24 +00:00
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 *
|
||||
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
Block a user