mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
conf: plug memory leaks
* src/conf/domain_conf.c (virDomainGraphicsDefParseXML) (virDomainDeviceVirtioSerialAddressParseXML) (virDomainDiskDefFree): Free various leaks.
This commit is contained in:
parent
7d5e79ffb9
commit
20eb73e955
@ -524,6 +524,7 @@ void virDomainDiskDefFree(virDomainDiskDefPtr def)
|
|||||||
|
|
||||||
for (i = 0 ; i < def->nhosts ; i++)
|
for (i = 0 ; i < def->nhosts ; i++)
|
||||||
virDomainDiskHostDefFree(&def->hosts[i]);
|
virDomainDiskHostDefFree(&def->hosts[i]);
|
||||||
|
VIR_FREE(def->hosts);
|
||||||
|
|
||||||
VIR_FREE(def);
|
VIR_FREE(def);
|
||||||
}
|
}
|
||||||
@ -1420,6 +1421,7 @@ virDomainDeviceVirtioSerialAddressParseXML(
|
|||||||
cleanup:
|
cleanup:
|
||||||
VIR_FREE(controller);
|
VIR_FREE(controller);
|
||||||
VIR_FREE(bus);
|
VIR_FREE(bus);
|
||||||
|
VIR_FREE(port);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3491,6 +3493,8 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, int flags) {
|
|||||||
if (!name || !mode) {
|
if (!name || !mode) {
|
||||||
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virDomainReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
_("spice channel missing name/mode"));
|
_("spice channel missing name/mode"));
|
||||||
|
VIR_FREE(name);
|
||||||
|
VIR_FREE(mode);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3498,14 +3502,20 @@ virDomainGraphicsDefParseXML(xmlNodePtr node, int flags) {
|
|||||||
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unknown spice channel name %s"),
|
_("unknown spice channel name %s"),
|
||||||
name);
|
name);
|
||||||
|
VIR_FREE(name);
|
||||||
|
VIR_FREE(mode);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if ((modeval = virDomainGraphicsSpiceChannelModeTypeFromString(mode)) < 0) {
|
if ((modeval = virDomainGraphicsSpiceChannelModeTypeFromString(mode)) < 0) {
|
||||||
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unknown spice channel mode %s"),
|
_("unknown spice channel mode %s"),
|
||||||
mode);
|
mode);
|
||||||
|
VIR_FREE(name);
|
||||||
|
VIR_FREE(mode);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
VIR_FREE(name);
|
||||||
|
VIR_FREE(mode);
|
||||||
|
|
||||||
def->data.spice.channels[nameval] = modeval;
|
def->data.spice.channels[nameval] = modeval;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user