Set the size of the packet counts array when we create it.

g_array_sized_new() sets the amount of *space allocated for* the array,
but doesn't actually set its *length*.

Change-Id: Ia7deab34c758c88910dfb0e246a6903301e68029
Reviewed-on: https://code.wireshark.org/review/15806
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2016-06-10 00:31:36 -07:00
parent 3ba7798cb1
commit 1438d28768
1 changed files with 1 additions and 0 deletions

View File

@ -1107,6 +1107,7 @@ process_cap_file(wtap *wth, const char *filename)
cf_info.num_interfaces = idb_info->interface_data->len;
cf_info.interface_packet_counts = g_array_sized_new(FALSE, TRUE, sizeof(guint32), cf_info.num_interfaces);
g_array_set_size(cf_info.interface_packet_counts, cf_info.num_interfaces);
cf_info.pkt_interface_id_unknown = 0;
g_free(idb_info);