aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/rtp_stream_dlg.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-01-04 21:40:05 -0500
committerMichael Mann <mmann78@netscape.net>2015-01-05 13:55:04 +0000
commit22b4ec91c006fec65e655ccbb0dbbc32438f820b (patch)
tree033dc9de28b8a79550a4dd769fcfb249df4be38c /ui/gtk/rtp_stream_dlg.c
parent9a7318a184e25e08d1c8449e3f826e0a5c66ca3b (diff)
Replace ep_display_to_address with wmem equivalent display_to_address.
Almost all instances require using "manual" memory management, but it gets some ep_ calls out of the GUI. Change-Id: Ifa7303766b08d09442ccf3d7063cbe061578ecd9 Reviewed-on: https://code.wireshark.org/review/6318 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/gtk/rtp_stream_dlg.c')
-rw-r--r--ui/gtk/rtp_stream_dlg.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/ui/gtk/rtp_stream_dlg.c b/ui/gtk/rtp_stream_dlg.c
index 4df1879170..89d1fb9729 100644
--- a/ui/gtk/rtp_stream_dlg.c
+++ b/ui/gtk/rtp_stream_dlg.c
@@ -557,6 +557,7 @@ rtpstream_view_selection_func(GtkTreeSelection *selection, GtkTreeModel *model,
rtp_stream_info_t* selected_stream;
gboolean result = TRUE;
gchar label_text[80];
+ char *src_addr, *dst_addr;
/* Logic
* nb_selected path_currently_selected forward reverse action result
@@ -627,11 +628,13 @@ rtpstream_view_selection_func(GtkTreeSelection *selection, GtkTreeModel *model,
}
}
+ src_addr = (char*)address_to_display(NULL, &(selected_stream_fwd->src_addr));
+ dst_addr = (char*)address_to_display(NULL, &(selected_stream_fwd->dest_addr));
if (selected_stream_fwd) {
g_snprintf(label_text, sizeof(label_text), "Forward: %s:%u -> %s:%u, SSRC=0x%X",
- ep_address_to_display(&(selected_stream_fwd->src_addr)),
+ src_addr,
selected_stream_fwd->src_port,
- ep_address_to_display(&(selected_stream_fwd->dest_addr)),
+ dst_addr,
selected_stream_fwd->dest_port,
selected_stream_fwd->ssrc
);
@@ -642,12 +645,16 @@ rtpstream_view_selection_func(GtkTreeSelection *selection, GtkTreeModel *model,
else
gtk_label_set_text(GTK_LABEL(label_fwd), FWD_LABEL_TEXT);
}
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
+ src_addr = (char*)address_to_display(NULL, &(selected_stream_rev->src_addr));
+ dst_addr = (char*)address_to_display(NULL, &(selected_stream_rev->dest_addr));
if (selected_stream_rev) {
g_snprintf(label_text, sizeof(label_text), "Reverse: %s:%u -> %s:%u, SSRC=0x%X",
- ep_address_to_display(&(selected_stream_rev->src_addr)),
+ src_addr,
selected_stream_rev->src_port,
- ep_address_to_display(&(selected_stream_rev->dest_addr)),
+ dst_addr,
selected_stream_rev->dest_port,
selected_stream_rev->ssrc
);
@@ -655,6 +662,8 @@ rtpstream_view_selection_func(GtkTreeSelection *selection, GtkTreeModel *model,
} else {
gtk_label_set_text(GTK_LABEL(label_rev), REV_LABEL_TEXT);
}
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
return result;
}
@@ -673,6 +682,7 @@ add_to_list_store(rtp_stream_info_t* strinfo)
double perc;
int i;
char *savelocale;
+ char *src_addr, *dst_addr;
/* save the current locale */
savelocale = g_strdup(setlocale(LC_NUMERIC, NULL));
@@ -680,9 +690,12 @@ add_to_list_store(rtp_stream_info_t* strinfo)
in g_snprintf("%f") functions */
setlocale(LC_NUMERIC, "C");
- data[0] = g_strdup(ep_address_to_display(&(strinfo->src_addr)));
+ src_addr = (char*)address_to_display(NULL, &(strinfo->src_addr));
+ dst_addr = (char*)address_to_display(NULL, &(strinfo->dest_addr));
+
+ data[0] = g_strdup(src_addr);
data[1] = NULL;
- data[2] = g_strdup(ep_address_to_display(&(strinfo->dest_addr)));
+ data[2] = g_strdup(dst_addr);
data[3] = NULL;
data[4] = g_strdup_printf("0x%X", strinfo->ssrc);
if (strinfo->payload_type_name != NULL) {
@@ -736,6 +749,8 @@ add_to_list_store(rtp_stream_info_t* strinfo)
for (i = 0; i < NUM_COLS-1; i++)
g_free(data[i]);
+ wmem_free(NULL, src_addr);
+ wmem_free(NULL, dst_addr);
/* Update the top label with the number of detected streams */
g_snprintf(label_text, sizeof(label_text),