[PATCH 4/6] lxc: Check for non NULL usb prior to calling usbFreeDevice()

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

 



---
 src/lxc/lxc_driver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 8050ce6..d4b4989 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3468,7 +3468,8 @@ cleanup:
     if (ret < 0 && created)
         unlink(dstfile);
 
-    usbFreeDevice(usb);
+    if (usb)
+        usbFreeDevice(usb);
     virCgroupFree(&group);
     VIR_FREE(src);
     VIR_FREE(dstfile);
@@ -4022,7 +4023,8 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver,
     ret = 0;
 
 cleanup:
-    usbFreeDevice(usb);
+    if (usb)
+        usbFreeDevice(usb);
     VIR_FREE(dst);
     virCgroupFree(&group);
     return ret;
-- 
1.7.11.7

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[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]