[PATCH 5/9] rpc: Add coverity[dead_error_begin] tag

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

 



Coverity misses the nuance of VIR_FREE(privkey) setting privkey = NULL when
if (!(virFileExists(privkey))) is true and thus declares the code dead.
---
 src/rpc/virnetclient.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c
index 44638e2..7550968 100644
--- a/src/rpc/virnetclient.c
+++ b/src/rpc/virnetclient.c
@@ -430,6 +430,7 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host,
                 VIR_FREE(privkey);
             /* DSA */
             if (!privkey) {
+                /* coverity[dead_error_begin] */
                 virBufferAsprintf(&buf, "%s/.ssh/id_dsa", homedir);
                 if (!(privkey = virBufferContentAndReset(&buf)))
                     goto no_memory;
-- 
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]