xen_xl: Check for virConfSetValue() retval

There's one case where the return value of virConfSetValue() is
not checked for and it's in xenFormatXLInputDevs() function.
Let's fix that.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Michal Privoznik 2022-01-14 10:36:42 +01:00
parent dfda149e15
commit 8b12f6af0b

View File

@ -1853,7 +1853,11 @@ xenFormatXLInputDevs(virConf *conf, virDomainDef *def)
goto error;
virConfFreeValue(usbdevices);
} else {
virConfSetValue(conf, "usbdevice", usbdevices);
if (virConfSetValue(conf, "usbdevice", usbdevices) < 0) {
usbdevices = NULL;
goto error;
}
usbdevices = NULL;
}
} else {
VIR_FREE(usbdevices);