Allocate col_text and col_text_len when the fdata struct is allocated.

svn path=/trunk/; revision=29817
This commit is contained in:
Anders Broman 2009-09-09 08:50:06 +00:00
parent 0c5dfd7698
commit 1e137770e6
2 changed files with 2 additions and 9 deletions

View File

@ -632,8 +632,6 @@ show_cell_data_func(GtkTreeViewColumn *col _U_, GtkCellRenderer *renderer,
fdata = record->fdata;
if (!record->columnized || !record->colorized) {
g_assert((fdata->col_text == NULL && !record->columnized) ||
(fdata->col_text != NULL && record->columnized));
packet_list_dissect_and_cache_iter(packetlist, iter,
!record->columnized,
!record->colorized);

View File

@ -673,17 +673,12 @@ packet_list_change_record(PacketList *packet_list, guint row, gint col, column_i
g_assert(record->physical_pos == row);
g_assert((record->fdata->col_text != NULL)&&(record->fdata->col_text_len != NULL));
if (record->fdata->col_text && record->fdata->col_text[col] != NULL)
/* TODO: Column already contains a value. Bail out */
return;
if (!record->fdata->col_text) {
record->fdata->col_text_len = se_alloc0(sizeof(record->fdata->col_text) *
(packet_list->n_columns-1));
record->fdata->col_text = se_alloc0(sizeof(record->fdata->col_text) *
(packet_list->n_columns-1));
}
switch (cfile.cinfo.col_fmt[col]) {
case COL_DEF_SRC:
case COL_RES_SRC: /* COL_DEF_SRC is currently just like COL_RES_SRC */