We have to initialize the elements of the fdata->col_text array to null

pointers, as there's code that assumes that if they're not set to null
pointers, they're set correctly, and doesn't bother setting them to the
right value.

svn path=/trunk/; revision=36252
This commit is contained in:
Guy Harris 2011-03-22 16:33:39 +00:00
parent 20c8fe0f7a
commit 8ca97915c3
1 changed files with 1 additions and 8 deletions

9
file.c
View File

@ -1160,19 +1160,12 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf,
/*
* Initialize the col_text and col_text_len arrays.
* We allocate them, and initialize them to point to a bunch of null
* strings, so that if the columns don't all get set to valid values,
* they are empty.
*/
static void
init_col_text(frame_data *fdata, gint num_cols)
{
gint i;
fdata->col_text_len = se_alloc0(sizeof(fdata->col_text_len) * num_cols);
fdata->col_text = se_alloc(sizeof(fdata->col_text) * num_cols);
for (i = 0; i < num_cols; i++)
fdata->col_text[i] = "";
fdata->col_text = se_alloc0(sizeof(fdata->col_text) * num_cols);
}
/* read in a new packet */