[PATCH 2/6] vmware: Avoid NULL dereference for 'caps'

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

 



When virCapabilitiesNew() fails, caps will be NULL resulting in possible
core when deref'd in cpuDataFree() call.
---
 src/vmware/vmware_conf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c
index b514636..fd9c473 100644
--- a/src/vmware/vmware_conf.c
+++ b/src/vmware/vmware_conf.c
@@ -127,7 +127,8 @@ vmwareCapsInit(void)
 
 cleanup:
     virCPUDefFree(cpu);
-    cpuDataFree(caps->host.arch, data);
+    if (caps)
+        cpuDataFree(caps->host.arch, data);
 
     return caps;
 
-- 
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]