From: Michal Privoznik Date: Fri, 14 Jan 2022 09:36:42 +0000 (+0100) Subject: xen_xl: Check for virConfSetValue() retval X-Git-Tag: v8.1.0-rc1~432 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b12f6af0b13337a18f7eead341f6b5316dfe1dc;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index 94268fb76d..e3ddae8827 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -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);