From: Matthias Bolte Date: Thu, 6 Aug 2009 13:07:46 +0000 (+0200) Subject: Add proper OOM reporting for esxDomainGetOSType X-Git-Tag: v0.7.1~219 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7c76142a064da09a1804aa0724c53b668ae45c6;p=thirdparty%2Flibvirt.git Add proper OOM reporting for esxDomainGetOSType * src/esx/esx_driver.c: catch an unchecked strdup in esxDomainGetOSType() --- 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; }