From 8b12f6af0b13337a18f7eead341f6b5316dfe1dc Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 14 Jan 2022 10:36:42 +0100 Subject: [PATCH] xen_xl: Check for virConfSetValue() retval MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/libxl/xen_xl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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);