do not call proto_tree_add_...() inside PROTO_ITEM_SET_HIDDEN() macro

it creates item three times

svn path=/trunk/; revision=26269
This commit is contained in:
Tomas Kukosa 2008-09-25 18:32:14 +00:00
parent 0996e23a81
commit 4981dbb788
1 changed files with 5 additions and 2 deletions

View File

@ -1414,6 +1414,7 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
{
gint tvb_current_offset,tvb_previous_offset,tvb_len,tvb_current_len;
gint tokennum, tokenlen;
proto_item* hidden_item;
char *transid = NULL;
char *code = NULL;
char *endpointId = NULL;
@ -1551,7 +1552,8 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
switch (mgcp_type)
{
case MGCP_RESPONSE:
PROTO_ITEM_SET_HIDDEN(proto_tree_add_boolean(tree, hf_mgcp_rsp, tvb, 0, 0, TRUE));
hidden_item = proto_tree_add_boolean(tree, hf_mgcp_rsp, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(hidden_item);
/* Check for MGCP response. A response must match a call that
we've seen, and the response must be sent to the same
port and address that the call came from, and must
@ -1656,7 +1658,8 @@ static void dissect_mgcp_firstline(tvbuff_t *tvb, packet_info *pinfo, proto_tree
}
break;
case MGCP_REQUEST:
PROTO_ITEM_SET_HIDDEN(proto_tree_add_boolean(tree, hf_mgcp_req, tvb, 0, 0, TRUE));
hidden_item = proto_tree_add_boolean(tree, hf_mgcp_req, tvb, 0, 0, TRUE);
PROTO_ITEM_SET_HIDDEN(hidden_item);
/* Keep track of the address and port whence the call came,
* and the port to which the call is being sent, so that
* we can match up calls with replies.