aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-symantec.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-04-12 14:08:41 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2014-04-12 12:12:59 +0000
commitc00de8797ceb2329e1cee1682d761e63109efee7 (patch)
tree46fb16c113503f9132ad69d57791eda951464019 /epan/dissectors/packet-symantec.c
parent37f85507ddc106bf2e91e4c8faa01d1b182c7110 (diff)
no need for if(tree)
Change-Id: Ic74a8f080628dc200fe1f5a4d34ff5f9bb60e232 Reviewed-on: https://code.wireshark.org/review/1079 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-symantec.c')
-rw-r--r--epan/dissectors/packet-symantec.c42
1 files changed, 19 insertions, 23 deletions
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