[PATCH 03/11] xen_xl: Check for virConfSetValue() retval

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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);
-- 
2.34.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux