aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarkjames <darkjames@f5534014-38df-0310-8fa8-9805f1628bb7>2011-06-05 19:35:36 +0000
committerdarkjames <darkjames@f5534014-38df-0310-8fa8-9805f1628bb7>2011-06-05 19:35:36 +0000
commitbf9ac5e83936f9782dbbcbc175796957b64f3535 (patch)
tree41e50ed4f04cb9f7308edb3987b2addc596af3ed
parent39430eea7ecfac96c93b5ec9554f719c847a9e6f (diff)
Fix memleaks and sigsegv when coping to clipboard RTP Streams.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@37554 f5534014-38df-0310-8fa8-9805f1628bb7
-rw-r--r--gtk/rtp_stream_dlg.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk/rtp_stream_dlg.c b/gtk/rtp_stream_dlg.c
index 6c241ac640..e9afbefec4 100644
--- a/gtk/rtp_stream_dlg.c
+++ b/gtk/rtp_stream_dlg.c
@@ -456,6 +456,7 @@ rtpstream_on_copy_as_csv(GtkWindow *win _U_, gpointer data _U_)
GtkTreeIter iter;
guint i,j;
gchar *table_entry;
+ guint table_entry_uint;
GString *CSV_str;
GtkClipboard *cb;
@@ -474,8 +475,14 @@ rtpstream_on_copy_as_csv(GtkWindow *win _U_, gpointer data _U_)
if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(list_store), &iter)) {
for (i=0; i<streams_nb; i++) {
for (j=0; j<NUM_COLS-1; j++) {
- gtk_tree_model_get(GTK_TREE_MODEL(list_store), &iter, j, &table_entry, -1);
- g_string_append_printf(CSV_str, "\"%s\"", table_entry);
+ if (j == RTP_COL_SRC_PORT || j == RTP_COL_DST_PORT || j == RTP_COL_PACKETS) {
+ gtk_tree_model_get(GTK_TREE_MODEL(list_store), &iter, j, &table_entry_uint, -1);
+ g_string_append_printf(CSV_str, "\"%u\"", table_entry_uint);
+ } else {
+ gtk_tree_model_get(GTK_TREE_MODEL(list_store), &iter, j, &table_entry, -1);
+ g_string_append_printf(CSV_str, "\"%s\"", table_entry);
+ g_free(table_entry);
+ }
if (j<NUM_COLS-2) g_string_append(CSV_str,",");
}
g_string_append(CSV_str,"\n");