summaryrefslogtreecommitdiff
path: root/capinfos.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-06-10 00:31:36 -0700
committerGuy Harris <guy@alum.mit.edu>2016-06-10 07:32:10 +0000
commit1438d28768023cc185a3fa4237cb2842bbb5df31 (patch)
treed93752eae55ebc930c7e76693bfb3012c92abaad /capinfos.c
parent3ba7798cb14573872f1ce502e6271e256d2ead28 (diff)
downloadwireshark-1438d28768023cc185a3fa4237cb2842bbb5df31.tar.gz
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>
Diffstat (limited to 'capinfos.c')
-rw-r--r--capinfos.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/capinfos.c b/capinfos.c
index 2261e7e6e1..f36e07a633 100644
--- a/capinfos.c
+++ b/capinfos.c
@@ -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);