[PATCH 4/6] xenapi: Resolve Coverity NULL_RETURNS

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

 



Coverity points out that the return from virDomainDefParseString is
not checked in xenapiDomainCreateXML like it should be which could
end up in a pointer dereference

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/xenapi/xenapi_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index 821e9d9..148ff9b 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -560,6 +560,8 @@ xenapiDomainCreateXML(virConnectPtr conn,
                                                      priv->caps, priv->xmlopt,
                                                      1 << VIR_DOMAIN_VIRT_XEN,
                                                      parse_flags);
+    if (!defPtr)
+        return NULL;
     createVMRecordFromXml(conn, defPtr, &record, &vm);
     virDomainDefFree(defPtr);
     if (record) {
-- 
2.1.0

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