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 <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2017-10-03 10:38:50 +02:00
parent 83a517cfe6
commit 02555bfe5c

View File

@ -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;