From c00de8797ceb2329e1cee1682d761e63109efee7 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Sat, 12 Apr 2014 14:08:41 +0200 Subject: no need for if(tree) Change-Id: Ic74a8f080628dc200fe1f5a4d34ff5f9bb60e232 Reviewed-on: https://code.wireshark.org/review/1079 Reviewed-by: Martin Kaiser --- epan/dissectors/packet-symantec.c | 42 ++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'epan/dissectors/packet-symantec.c') diff --git a/epan/dissectors/packet-symantec.c b/epan/dissectors/packet-symantec.c index 5bb13d2ba7..4723a7d49e 100644 --- a/epan/dissectors/packet-symantec.c +++ b/epan/dissectors/packet-symantec.c @@ -45,7 +45,7 @@ static void dissect_symantec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_item *ti; - proto_tree *symantec_tree = NULL; + proto_tree *symantec_tree; guint16 etypev2, etypev3; tvbuff_t *next_tvb; @@ -81,17 +81,15 @@ dissect_symantec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (etypev3 == 0) { /* SEF and SGS v2 processing */ col_set_str(pinfo->cinfo, COL_INFO, "Symantec Enterprise Firewall"); - if (tree) { - ti = proto_tree_add_protocol_format(tree, proto_symantec, tvb, - 0, 44, "Symantec firewall"); - symantec_tree = proto_item_add_subtree(ti, ett_symantec); - } - if (tree) { - proto_tree_add_item(symantec_tree, hf_symantec_if, tvb, - 0, 4, ENC_BIG_ENDIAN); - proto_tree_add_uint(symantec_tree, hf_symantec_etype, tvb, - 6, 2, etypev2); - } + + ti = proto_tree_add_protocol_format(tree, proto_symantec, tvb, + 0, 44, "Symantec firewall"); + symantec_tree = proto_item_add_subtree(ti, ett_symantec); + proto_tree_add_item(symantec_tree, hf_symantec_if, tvb, + 0, 4, ENC_BIG_ENDIAN); + proto_tree_add_uint(symantec_tree, hf_symantec_etype, tvb, + 6, 2, etypev2); + next_tvb = tvb_new_subset_remaining(tvb, 44); dissector_try_uint(ethertype_dissector_table, etypev2, next_tvb, pinfo, tree); @@ -99,17 +97,15 @@ dissect_symantec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (etypev2 == 0) { /* SGS v3 processing */ col_set_str(pinfo->cinfo, COL_INFO, "Symantec SGS v3"); - if (tree) { - ti = proto_tree_add_protocol_format(tree, proto_symantec, tvb, - 0, 56, "Symantec SGSv3"); - symantec_tree = proto_item_add_subtree(ti, ett_symantec); - } - if (tree) { - proto_tree_add_item(symantec_tree, hf_symantec_if, tvb, - 0, 4, ENC_BIG_ENDIAN); - proto_tree_add_uint(symantec_tree, hf_symantec_etype, tvb, - 10, 2, etypev3); - } + + ti = proto_tree_add_protocol_format(tree, proto_symantec, tvb, + 0, 56, "Symantec SGSv3"); + symantec_tree = proto_item_add_subtree(ti, ett_symantec); + proto_tree_add_item(symantec_tree, hf_symantec_if, tvb, + 0, 4, ENC_BIG_ENDIAN); + proto_tree_add_uint(symantec_tree, hf_symantec_etype, tvb, + 10, 2, etypev3); + /* * Dissection of VLAN information will have to wait until * availability of a capture file from an SGSv3 box using VLAN -- cgit v1.2.3