]> xenbits.xensource.com Git - libvirt.git/commitdiff
rpc: Add coverity[dead_error_begin] tag
authorJohn Ferlan <jferlan@redhat.com>
Tue, 22 Jan 2013 14:41:00 +0000 (09:41 -0500)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 22 Jan 2013 15:59:45 +0000 (16:59 +0100)
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

index 44638e2bda5a9b65a6b51c4125827b58aec00fda..75509682beaaa3044c2196e7869b78048828dd25 100644 (file)
@@ -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;