[PATCH 10/10] build: silence coverity false positive

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

 



* src/remote/remote_driver.c (remoteGenericOpen): Help coverity.
---
 src/remote/remote_driver.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 14c3d24..fcb4c14 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -2547,8 +2547,13 @@ remoteGenericOpen(virConnectPtr conn, virConnectAuthPtr auth,
         struct private_data *priv;
         int ret;
         ret = remoteOpenSecondaryDriver(conn, auth, flags, &priv);
-        if (ret == VIR_DRV_OPEN_SUCCESS)
+        if (ret == VIR_DRV_OPEN_SUCCESS) {
             *genericPrivateData = priv;
+        } else {
+            /* Coverity 5.3.0 missed that remoteOpenSecondaryDriver
+             * guarantees priv is clean on failure.  */
+            sa_assert(!priv);
+        }
         return ret;
     }
 }
-- 
1.7.4.4

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