From: Michal Privoznik Date: Tue, 3 Oct 2017 08:38:50 +0000 (+0200) Subject: virDomainDeviceInfoParseXML: Clear whole @info on failure X-Git-Tag: CVE-2017-1000256~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02555bfe5c84888e9e96d098f39a06cde751ea11;p=thirdparty%2Flibvirt.git virDomainDeviceInfoParseXML: Clear whole @info on failure Currently, if parsing of device info fails info->alias is freed. It doesn't make much sense to leave the rest of the struct behind. Signed-off-by: Michal Privoznik --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0b9d2d9d52..0f306b7e15 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6476,7 +6476,7 @@ virDomainDeviceInfoParseXML(xmlNodePtr node, ret = 0; cleanup: if (ret < 0) - VIR_FREE(info->alias); + virDomainDeviceInfoClear(info); VIR_FREE(type); VIR_FREE(rombar); return ret;