Fix various benign cases of Coverity [UNUSED]: 996,995,956,936,899,1133,1000
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 23 May 2011 18:04:45 +0000 (18:04 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 23 May 2011 18:04:45 +0000 (18:04 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37371 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-fcgi.c
epan/dissectors/packet-infiniband.c
epan/dissectors/packet-kerberos.c
epan/dissectors/packet-nisplus.c
epan/dissectors/packet-nlsp.c
epan/dissectors/packet-pgsql.c
epan/dissectors/packet-xtp.c

index 2edad61971f132897c9c9df5b31466430ed7b34b..1d811373afbb77adf5cddaafc94d213e35a387ee 100644 (file)
@@ -50,7 +50,6 @@ static int hf_fcgi_end_request_protocol_status = -1;
 
 static int ett_fcgi = -1;
 static int ett_fcgi_begin_request = -1;
-static int ett_fcgi_abort_request = -1;
 static int ett_fcgi_end_request = -1;
 static int ett_fcgi_params = -1;
 
@@ -166,11 +165,7 @@ dissect_begin_request(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16
 static void
 dissect_abort_request(tvbuff_t *tvb, proto_tree *fcgi_tree, gint offset, guint16 len)
 {
-   proto_item *ar;
-   proto_tree *ar_tree;
-
-   ar = proto_tree_add_text(fcgi_tree, tvb, offset, len, "Abort Request:");
-   ar_tree = proto_item_add_subtree(ar, ett_fcgi_abort_request);
+   proto_tree_add_text(fcgi_tree, tvb, offset, len, "Abort Request:");
 
    return;
 }
@@ -384,7 +379,6 @@ proto_register_fcgi(void)
    static gint *ett[] = {
       &ett_fcgi,
       &ett_fcgi_begin_request,
-      &ett_fcgi_abort_request,
       &ett_fcgi_end_request,
       &ett_fcgi_params
    };
index 8cc36d225dbfeb6332eacfd7cb0b5a438bceef4b..a82c144f5e460c3dfe1291cd9cef99a18680bf80 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
-#include <stdlib.h>
+
 #include <glib.h>
 #include <epan/packet.h>
 #include <epan/proto.h>
@@ -53,7 +53,6 @@ static gint ett_lrh = -1;
 static gint ett_grh = -1;
 static gint ett_bth = -1;
 static gint ett_rwh = -1;
-static gint ett_rawdata = -1;
 static gint ett_rdeth = -1;
 static gint ett_deth = -1;
 static gint ett_reth = -1;
@@ -1608,7 +1607,6 @@ dissect_infiniband_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, g
     proto_item *base_transport_header_item = NULL;
 
     /* Raw Data */
-    proto_tree *RAWDATA_header_tree;
     proto_item *RAWDATA_header_item;
     guint8 lnh_val = 0;             /* Link Next Header Value */
     gint offset = 0;                /* Current Offset */
@@ -1823,7 +1821,6 @@ skip_lrh:
             /* Unknown Packet */
             RAWDATA_header_item = proto_tree_add_item(all_headers_tree, hf_infiniband_raw_data, tvb, offset, -1, FALSE);
             proto_item_set_text(RAWDATA_header_item, "%s", "Unknown Raw Data - IB Encapsulated");
-            RAWDATA_header_tree = proto_item_add_subtree(RAWDATA_header_item, ett_rawdata);
             break;
     }
 
@@ -7319,7 +7316,6 @@ void proto_register_infiniband(void)
         &ett_grh,
         &ett_bth,
         &ett_rwh,
-        &ett_rawdata,
         &ett_rdeth,
         &ett_deth,
         &ett_reth,
index 8d4c9f3a64cc372b5ad2be3a0bf7d2dc419340b6..08a5617b293033f625e1dd8e8d24796cb6d2b069 100644 (file)
@@ -301,7 +301,6 @@ static gint hf_krb_midl_hdr_len = -1;
 static gint ett_krb_kerberos = -1;
 static gint ett_krb_TransitedEncoding = -1;
 static gint ett_krb_PAC_LOGON_INFO = -1;
-static gint ett_krb_PAC_CREDENTIAL_TYPE = -1;
 static gint ett_krb_PAC_SERVER_CHECKSUM = -1;
 static gint ett_krb_PAC_PRIVSVR_CHECKSUM = -1;
 static gint ett_krb_PAC_CLIENT_INFO_TYPE = -1;
@@ -2749,13 +2748,7 @@ dissect_krb5_PAC_UPN_DNS_INFO(proto_tree *parent_tree, tvbuff_t *tvb, int offset
 static int
 dissect_krb5_PAC_CREDENTIAL_TYPE(proto_tree *parent_tree, tvbuff_t *tvb, int offset, asn1_ctx_t *actx _U_)
 {
-    proto_item *item=NULL;
-    proto_tree *tree=NULL;
-
-    item=proto_tree_add_item(parent_tree, hf_krb_PAC_CREDENTIAL_TYPE, tvb, offset, tvb_length_remaining(tvb, offset), FALSE);
-    if(parent_tree){
-        tree=proto_item_add_subtree(item, ett_krb_PAC_CREDENTIAL_TYPE);
-    }
+    proto_tree_add_item(parent_tree, hf_krb_PAC_CREDENTIAL_TYPE, tvb, offset, tvb_length_remaining(tvb, offset), FALSE);
 
 /*qqq*/
     return offset;
@@ -5407,7 +5400,6 @@ proto_register_kerberos(void)
         &ett_krb_TransitedEncoding,
         &ett_krb_PAC,
         &ett_krb_PAC_LOGON_INFO,
-        &ett_krb_PAC_CREDENTIAL_TYPE,
         &ett_krb_PAC_SERVER_CHECKSUM,
         &ett_krb_PAC_PRIVSVR_CHECKSUM,
         &ett_krb_PAC_CLIENT_INFO_TYPE,
index 5753db545d95b26f7b736a4829814cdb85fe130d..97c854040827b5ceca49602ff65c353591b7bcd8 100644 (file)
@@ -1877,13 +1877,13 @@ static int
 dissect_cb_entry(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
 {
        proto_item* lock_item = NULL;
-       proto_tree* lock_tree = NULL;
+       /* proto_tree* lock_tree = NULL; */
        int old_offset = offset;
 
        lock_item = proto_tree_add_item(tree, hf_nispluscb_entry,
                        tvb, offset, -1, FALSE);
 
-       lock_tree = proto_item_add_subtree(lock_item, ett_nispluscb_entry);
+       /* lock_tree = proto_item_add_subtree(lock_item, ett_nispluscb_entry); */
 
 /*XXXXX Not implemented yet*/
 
index 6697eba73e35dd3278d982875c9206eaa7d02d41..8bf00ebffc1a789b5f24d00d3725ef30c68c6761 100644 (file)
@@ -160,6 +160,12 @@ nlsp_dissect_unknown(tvbuff_t *tvb, proto_tree *tree, int offset,
  *     a matching code.  If found, we add to the display tree and
  *     then call the dissector.  If it is not, we just post an
  *     "unknown" clv entry using the passed in unknown clv tree id.
+ *      XXX: The "unknown tree id" is an 'ett' index for use
+ *           when creating a subtree;
+ *           Since the 'unknown' subtree was not actually used in the
+ *           code below, what was the intention for this ?
+ *           For now: code related to creating an 'unknown' subtrree
+ *            disabled.
  *
  * Input:
  *     tvbuff_t * : tvbuffer for packet data
@@ -175,7 +181,7 @@ nlsp_dissect_unknown(tvbuff_t *tvb, proto_tree *tree, int offset,
  */
 static void
 nlsp_dissect_clvs(tvbuff_t *tvb, proto_tree *tree, int offset,
-       const nlsp_clv_handle_t *opts, int len, int unknown_tree_id)
+       const nlsp_clv_handle_t *opts, int len, int unknown_tree_id _U_)
 {
        guint8 code;
        guint8 length;
@@ -221,10 +227,12 @@ nlsp_dissect_clvs(tvbuff_t *tvb, proto_tree *tree, int offset,
                                ti = proto_tree_add_text(tree, tvb, offset - 2,
                                        length + 2, "Unknown code %u (%u)",
                                        code, length);
+#if 0  /* XXX: ?? */
                                clv_tree = proto_item_add_subtree(ti,
                                        unknown_tree_id );
                        } else {
                                clv_tree = NULL;
+#endif
                        }
                }
                offset += length;
index f595624890f99b0c41c2a709ae68dc6280860073..5be51438a59911fbe01ceef74e6670a68d0f78db 100644 (file)
@@ -165,12 +165,12 @@ static const value_string format_vals[] = {
 static void
 dissect_pgsql(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
 {
-    conversation_t *cv;
+    /* conversation_t *cv; */
 
     first_message = TRUE;
 
     /* We don't use conversation data yet, but... */
-    cv = find_or_create_conversation(pinfo);
+    /* cv = find_or_create_conversation(pinfo); */
 
     col_set_str(pinfo->cinfo, COL_PROTOCOL, "PGSQL");
     if (check_col(pinfo->cinfo, COL_INFO))
index 8cf34d84fcea521e7afee4fdf0a219d71c24dee1..f8c5b57e1d8714f04a1b7e4f871f4fa83602aba5 100644 (file)
@@ -305,7 +305,6 @@ static int hf_xtp_diag_msg = -1;
 
 /* Initialize the subtree pointers */
 static gint ett_xtp = -1;
-static gint ett_xtp_key = -1;
 static gint ett_xtp_cmd = -1;
 static gint ett_xtp_cmd_options = -1;
 static gint ett_xtp_cmd_ptype = -1;
@@ -1007,7 +1006,6 @@ dissect_xtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
                offset = 0;
                ti = proto_tree_add_uint64(xtp_tree, hf_xtp_key,
                                        tvb, offset, 8, xtph->key);
-               xtp_subtree = proto_item_add_subtree(ti, ett_xtp_key);
                offset += 8;
                /* cmd(4) */
                ti = proto_tree_add_uint(xtp_tree, hf_xtp_cmd,
@@ -1411,7 +1409,6 @@ proto_register_xtp(void)
 
        static gint *ett[] = {
                &ett_xtp,
-               &ett_xtp_key,
                &ett_xtp_cmd,
                &ett_xtp_cmd_options,
                &ett_xtp_cmd_ptype,