From a7c76142a064da09a1804aa0724c53b668ae45c6 Mon Sep 17 00:00:00 2001 From: Matthias Bolte Date: Thu, 6 Aug 2009 15:07:46 +0200 Subject: [PATCH] Add proper OOM reporting for esxDomainGetOSType * src/esx/esx_driver.c: catch an unchecked strdup in esxDomainGetOSType() --- src/esx/esx_driver.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index dba6305a98..8b8575ce19 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -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; } -- 2.47.2