aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2010-01-25 18:22:56 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2010-01-25 18:22:56 +0000
commit9ea266105e0241250d072987b7d36520181bc443 (patch)
tree27de7fd49c8f9afdc69f10fccccc118920d75241
parent065546cdcb5b8e7a78ad93f011c3ad50ae2500e2 (diff)
downloadwireshark-9ea266105e0241250d072987b7d36520181bc443.tar.gz
wireshark-9ea266105e0241250d072987b7d36520181bc443.tar.bz2
wireshark-9ea266105e0241250d072987b7d36520181bc443.zip
From Didier Gautheron via bug 4420:
Use se_alloc rather than g_malloc for proto_data. Call conversation_add_proto_data only once. svn path=/trunk/; revision=31663
-rw-r--r--epan/dissectors/packet-rsync.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/epan/dissectors/packet-rsync.c b/epan/dissectors/packet-rsync.c
index 8d20dec511..9a5bd4465e 100644
--- a/epan/dissectors/packet-rsync.c
+++ b/epan/dissectors/packet-rsync.c
@@ -116,7 +116,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
conversation_data = conversation_get_proto_data(conversation, proto_rsync);
if (conversation_data == NULL) {
- conversation_data = g_malloc(sizeof(struct rsync_conversation_data));
+ conversation_data = se_alloc(sizeof(struct rsync_conversation_data));
conversation_data->state = RSYNC_INIT;
conversation_add_proto_data(conversation, proto_rsync, conversation_data);
}
@@ -130,7 +130,7 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
rsync_frame_data_p = p_get_proto_data(pinfo->fd, proto_rsync);
if (!rsync_frame_data_p) {
/* then we haven't seen this frame before */
- rsync_frame_data_p = g_malloc(sizeof(struct rsync_frame_data));
+ rsync_frame_data_p = se_alloc(sizeof(struct rsync_frame_data));
rsync_frame_data_p->state = conversation_data->state;
p_add_proto_data(pinfo->fd, proto_rsync, rsync_frame_data_p);
}
@@ -152,7 +152,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
conversation_data->state = RSYNC_SERV_INIT;
- conversation_add_proto_data(conversation, proto_rsync, conversation_data);
break;
case RSYNC_SERV_INIT:
@@ -171,7 +170,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
conversation_data->state = RSYNC_CLIENT_QUERY;
- conversation_add_proto_data(conversation, proto_rsync, conversation_data);
break;
case RSYNC_CLIENT_QUERY:
@@ -180,7 +178,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_append_str(pinfo->cinfo, COL_INFO, "Client Query");
conversation_data->state = RSYNC_SERV_MOTD;
- conversation_add_proto_data(conversation, proto_rsync, conversation_data);
break;
case RSYNC_SERV_MOTD:
@@ -189,7 +186,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_append_str(pinfo->cinfo, COL_INFO, "Server MOTD");
conversation_data->state = RSYNC_SERV_RESPONSE;
- conversation_add_proto_data(conversation, proto_rsync, conversation_data);
break;
case RSYNC_SERV_RESPONSE:
@@ -220,8 +216,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
}
}
- conversation_add_proto_data(conversation, proto_rsync, conversation_data);
-
break;
case RSYNC_COMMAND:
@@ -232,7 +226,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_append_str(pinfo->cinfo, COL_INFO, "Command");
conversation_data->state = RSYNC_COMMAND;
- conversation_add_proto_data(conversation, proto_rsync, conversation_data);
break;
} /* else we fall through to the data phase */
@@ -244,7 +237,6 @@ dissect_rsync_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
col_append_str(pinfo->cinfo, COL_INFO, "Data");
conversation_data->state = RSYNC_DATA;
- conversation_add_proto_data(conversation, proto_rsync, conversation_data);
break;