summaryrefslogtreecommitdiff
path: root/epan/conversation_table.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2015-11-26 04:44:52 +0000
committerJoão Valverde <j@v6e.pt>2016-02-07 23:22:30 +0000
commit13ec77a9fc3af3b0b502820d0b55796c89997896 (patch)
treec5f5f72f090efd5471cf95095b00e13efa407959 /epan/conversation_table.c
parentd762a895ab570680e4e72142a348ad2b07c97d4f (diff)
downloadwireshark-13ec77a9fc3af3b0b502820d0b55796c89997896.tar.gz
Add free_address_wmem() and other extensions to address API
Try to improve 'address' API (to be easier/safer) and also avoid some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Change-Id: I7456516b12c67620ceadac447907c12f5905bd49 Reviewed-on: https://code.wireshark.org/review/13463 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/conversation_table.c')
-rw-r--r--epan/conversation_table.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/conversation_table.c b/epan/conversation_table.c
index 1aaeabc4b3..12b9418663 100644
--- a/epan/conversation_table.c
+++ b/epan/conversation_table.c
@@ -285,8 +285,8 @@ reset_conversation_table_data(conv_hash_t *ch)
guint i;
for(i = 0; i < ch->conv_array->len; i++){
conv_item_t *conv = &g_array_index(ch->conv_array, conv_item_t, i);
- g_free((gpointer)conv->src_address.data);
- g_free((gpointer)conv->dst_address.data);
+ free_address(&conv->src_address);
+ free_address(&conv->dst_address);
}
g_array_free(ch->conv_array, TRUE);
@@ -310,7 +310,7 @@ void reset_hostlist_table_data(conv_hash_t *ch)
guint i;
for(i = 0; i < ch->conv_array->len; i++){
hostlist_talker_t *host = &g_array_index(ch->conv_array, hostlist_talker_t, i);
- g_free((gpointer)host->myaddress.data);
+ free_address(&host->myaddress);
}
g_array_free(ch->conv_array, TRUE);
@@ -769,7 +769,7 @@ add_hostlist_table_data(conv_hash_t *ch, const address *addr, guint32 port, gboo
host_key_t existing_key;
gpointer talker_idx_hash_val;
- existing_key.myaddress = *addr;
+ copy_address_shallow(&existing_key.myaddress, addr);
existing_key.port = port;
if (g_hash_table_lookup_extended(ch->hashtable, &existing_key, NULL, &talker_idx_hash_val)) {