VIR_FREE(ram);
VIR_FREE(vram);
VIR_FREE(heads);
+ VIR_FREE(primary);
return def;
goto error;
}
+ VIR_FREE(tmp);
def->hyperv_features[feature] = value;
break;
if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) {
if (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE) {
if (usb_other || usb_none) {
+ virDomainControllerDefFree(controller);
virReportError(VIR_ERR_XML_DETAIL, "%s",
_("Can't add another USB controller: "
"USB is disabled for this domain"));
usb_none = true;
} else {
if (usb_none) {
+ virDomainControllerDefFree(controller);
virReportError(VIR_ERR_XML_DETAIL, "%s",
_("Can't add another USB controller: "
"USB is disabled for this domain"));
/* Check if USB bus is required */
if (input->bus == VIR_DOMAIN_INPUT_BUS_USB && usb_none) {
+ virDomainInputDefFree(input);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Can't add USB input device. "
"USB bus is disabled"));
if (video->primary) {
if (primaryVideo) {
+ virDomainVideoDefFree(video);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Only one primary video device is supported"));
goto error;
if (VIR_INSERT_ELEMENT_INPLACE(def->videos,
ii,
def->nvideos,
- video) < 0)
+ video) < 0) {
+ virDomainVideoDefFree(video);
goto error;
+ }
}
VIR_FREE(nodes);
goto error;
if (hub->type == VIR_DOMAIN_HUB_TYPE_USB && usb_none) {
+ virDomainHubDefFree(hub);
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Can't add USB hub: "
"USB is disabled for this domain"));