[PATCH 2/5] virnetserverclient: Remove Coverity DEADCODE warning

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

 



The x509dname is only set inside a WITH_GNUTLS conditional, so
when used/check later on for NULL, Coverity detects this is not
possible.  Added WITH_GNUTLS around uses to remove message

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

diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c
index 0b9ab52..8acf914 100644
--- a/src/rpc/virnetserverclient.c
+++ b/src/rpc/virnetserverclient.c
@@ -658,7 +658,9 @@ virNetServerClientCreateIdentity(virNetServerClientPtr client)
 #if WITH_SASL
     char *saslname = NULL;
 #endif
+#if WITH_GNUTLS
     char *x509dname = NULL;
+#endif
     char *seccontext = NULL;
     virIdentityPtr ret = NULL;
 
@@ -748,11 +750,13 @@ virNetServerClientCreateIdentity(virNetServerClientPtr client)
                            saslname) < 0)
         goto error;
 #endif
+#if WITH_GNUTLS
     if (x509dname &&
         virIdentitySetAttr(ret,
                            VIR_IDENTITY_ATTR_X509_DISTINGUISHED_NAME,
                            x509dname) < 0)
         goto error;
+#endif
     if (seccontext &&
         virIdentitySetAttr(ret,
                            VIR_IDENTITY_ATTR_SELINUX_CONTEXT,
@@ -770,7 +774,9 @@ cleanup:
 #if HAVE_SASL
     VIR_FREE(saslname);
 #endif
+#if WITH_GNUTLS
     VIR_FREE(x509dname);
+#endif
     return ret;
 
 error:
-- 
1.8.3.1

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