]> xenbits.xensource.com Git - libvirt.git/commitdiff
virDomainDeviceInfoParseXML: Clear whole @info on failure
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 3 Oct 2017 08:38:50 +0000 (10:38 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Sat, 14 Oct 2017 00:55:41 +0000 (17:55 -0700)
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>
src/conf/domain_conf.c

index 0b9d2d9d5271f1932411e872ae303593e3085ed8..0f306b7e15610cab15682bfb18620f0bbff41b64 100644 (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;