aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mysql.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2014-07-21 11:58:08 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2014-07-21 09:59:15 +0000
commitd52f4d5e0051901b7449848bc58f195f712b2ac9 (patch)
tree4ff2c787e7e11e09c06533dd362724aec52ab560 /epan/dissectors/packet-mysql.c
parentbcf0ea3b212e894d75f9c441834d776c926f0d35 (diff)
simplify the tree handling a bit
Change-Id: I887000ac2bb273a0cc0c41709e346e1cf52140d9 Reviewed-on: https://code.wireshark.org/review/3149 Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-mysql.c')
-rw-r--r--epan/dissectors/packet-mysql.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/epan/dissectors/packet-mysql.c b/epan/dissectors/packet-mysql.c
index 15f1e8aec8..8faaca10a0 100644
--- a/epan/dissectors/packet-mysql.c
+++ b/epan/dissectors/packet-mysql.c
@@ -717,7 +717,7 @@ mysql_dissect_greeting(tvbuff_t *tvb, packet_info *pinfo, int offset,
int ver_offset;
proto_item *tf;
- proto_item *greeting_tree= NULL;
+ proto_item *greeting_tree;
protocol= tvb_get_guint8(tvb, offset);
@@ -801,15 +801,13 @@ mysql_dissect_login(tvbuff_t *tvb, packet_info *pinfo, int offset,
gint lenstr;
proto_item *tf;
- proto_item *login_tree= NULL;
+ proto_item *login_tree;
/* after login there can be OK or DENIED */
conn_data->state = RESPONSE_OK;
- if (tree) {
- tf = proto_tree_add_item(tree, hf_mysql_login_request, tvb, offset, -1, ENC_NA);
- login_tree = proto_item_add_subtree(tf, ett_login_request);
- }
+ tf = proto_tree_add_item(tree, hf_mysql_login_request, tvb, offset, -1, ENC_NA);
+ login_tree = proto_item_add_subtree(tf, ett_login_request);
offset = mysql_dissect_caps_client(tvb, offset, login_tree, &conn_data->clnt_caps);
@@ -1056,15 +1054,13 @@ mysql_dissect_request(tvbuff_t *tvb,packet_info *pinfo, int offset,
gint opcode;
gint lenstr;
proto_item *tf = NULL, *ti;
- proto_item *req_tree = NULL;
+ proto_item *req_tree;
guint32 stmt_id;
my_stmt_data_t *stmt_data;
int stmt_pos, param_offset;
- if (tree) {
- tf = proto_tree_add_item(tree, hf_mysql_request, tvb, offset, 1, ENC_NA);
- req_tree = proto_item_add_subtree(tf, ett_request);
- }
+ tf = proto_tree_add_item(tree, hf_mysql_request, tvb, offset, 1, ENC_NA);
+ req_tree = proto_item_add_subtree(tf, ett_request);
opcode = tvb_get_guint8(tvb, offset);
col_append_fstr(pinfo->cinfo, COL_INFO, " %s", val_to_str(opcode, mysql_command_vals, "Unknown (%u)"));