summaryrefslogtreecommitdiff
path: root/ui/voip_calls.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-26 23:09:43 +0000
commite4c059f67f3b29bcc26b1faf111bf647ac630e04 (patch)
tree8ec634d7614f7a32c09c5cdb60d7509fc2dd2208 /ui/voip_calls.c
parent92537916483ec721a638cdd7c416d099a45a9304 (diff)
downloadwireshark-e4c059f67f3b29bcc26b1faf111bf647ac630e04.tar.gz
Add free_address_wmem(), fix warnings [-Wcast-qual]
Try to improve address API and also fix some constness warnings by not overloading the 'data' pointer to store malloc'ed buffers (use private pointer for that instead). Second try, now passing test suite. Change-Id: Idc101cd866b6d4f13500c9d59da5c7a38847fb7f Reviewed-on: https://code.wireshark.org/review/13946 Petri-Dish: João Valverde <j@v6e.pt> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'ui/voip_calls.c')
-rw-r--r--ui/voip_calls.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/ui/voip_calls.c b/ui/voip_calls.c
index 3fae9edc3c..a65b67e21e 100644
--- a/ui/voip_calls.c
+++ b/ui/voip_calls.c
@@ -280,7 +280,7 @@ voip_calls_reset_all_taps(voip_calls_tapinfo_t *tapinfo)
g_free(callsinfo->call_id);
g_free(callsinfo->from_identity);
g_free(callsinfo->to_identity);
- g_free((void *)(callsinfo->initial_speaker.data));
+ free_address(&callsinfo->initial_speaker);
g_free(callsinfo->protocol_name);
g_free(callsinfo->call_comment);
@@ -1227,8 +1227,8 @@ TODO: is useful but not perfect, what is appended is truncated when displayed in
add_to_graph(tapinfo, pinfo, edt, frame_label, comment, callsinfo->call_num, &(pinfo->src), &(pinfo->dst), 1);
g_free(comment);
g_free(frame_label);
- g_free((void *)tmp_src.data);
- g_free((void *)tmp_dst.data);
+ free_address(&tmp_src);
+ free_address(&tmp_dst);
/* add SDP info if apply */
if ( (tapinfo->sdp_summary != NULL) && (tapinfo->sdp_frame_num == pinfo->num) ) {
@@ -1663,7 +1663,7 @@ q931_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
while (list2)
{
h245_add=(h245_address_t *)list2->data;
- g_free((void *)h245_add->h245_address.data);
+ free_address(&h245_add->h245_address);
g_free(list2->data);
list2 = g_list_next(list2);
}
@@ -1822,7 +1822,7 @@ q931_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
wmem_free(NULL, tmp_str);
g_free(comment);
- g_free((char *)pstn_add.data);
+ free_address(&pstn_add);
}
tapinfo->redraw |= REDRAW_Q931;
@@ -1895,7 +1895,7 @@ free_h225_info(gpointer p) {
while (list2)
{
h245_address_t *h245_add=(h245_address_t *)list2->data;
- g_free((void *)h245_add->h245_address.data);
+ free_address(&h245_add->h245_address);
g_free(list2->data);
list2 = g_list_next(list2);
}
@@ -2026,10 +2026,7 @@ h225_calls_packet(void *tap_offset_ptr, packet_info *pinfo, epan_dissect_t *edt,
/* this is still IPv4 only, because the dissector is */
if (pi->is_h245 == TRUE) {
h245_add = (h245_address_t *)g_malloc(sizeof (h245_address_t));
- h245_add->h245_address.type=AT_IPv4;
- h245_add->h245_address.len=4;
- h245_add->h245_address.data = g_malloc(sizeof(pi->h245_address));
- memcpy((void *)(h245_add->h245_address.data), &(pi->h245_address), 4);
+ alloc_address_wmem(NULL, &h245_add->h245_address, AT_IPv4, 4, &pi->h245_address);
h245_add->h245_port = pi->h245_port;
add_h245_Address(tmp_h323info, h245_add);
}