aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rsync.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2010-01-25 18:22:56 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2010-01-25 18:22:56 +0000
commit9027ecd6898354c63debd0d706dcd60c5ca32f9b (patch)
tree27de7fd49c8f9afdc69f10fccccc118920d75241 /epan/dissectors/packet-rsync.c
parent17cf4b677aa6fe4633db57e060f10b072a6823b9 (diff)
From Didier Gautheron via bug 4420:
Use se_alloc rather than g_malloc for proto_data. Call conversation_add_proto_data only once. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@31663 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/dissectors/packet-rsync.c')
-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;