aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-diameter.c
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2016-10-03 09:59:52 +0200
committerAnders Broman <a.broman58@gmail.com>2016-10-03 10:21:58 +0000
commitaadec0f7659af0249bdba0a8718cd3bf2fd98a42 (patch)
treef1bcedd61e2c414967e04da62b85046a928d319d /epan/dissectors/packet-diameter.c
parent7849d29b24bc67ee208741decd67dd43d45dff0c (diff)
[Diameter] Use ...array_sized_new() for hf:s and ett:s
Change-Id: I5d3d3779ccf1fcd8a61e6cb6342305db2bc6e2be Reviewed-on: https://code.wireshark.org/review/18036 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-diameter.c')
-rw-r--r--epan/dissectors/packet-diameter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/epan/dissectors/packet-diameter.c b/epan/dissectors/packet-diameter.c
index 58adcfb8c3..77b949d89c 100644
--- a/epan/dissectors/packet-diameter.c
+++ b/epan/dissectors/packet-diameter.c
@@ -1880,8 +1880,9 @@ dictionary_load(void)
diam_vnd_t *vnd;
GArray *vnd_shrt_arr = g_array_new(TRUE,TRUE,sizeof(value_string));
- build_dict.hf = wmem_array_new(wmem_epan_scope(),sizeof(hf_register_info));
- build_dict.ett = g_ptr_array_new();
+ /* Pre allocate the arrays big enough to hold the hf:s and etts:s*/
+ build_dict.hf = wmem_array_sized_new(wmem_epan_scope(), sizeof(hf_register_info), 4096);
+ build_dict.ett = g_ptr_array_sized_new(4096);
build_dict.types = g_hash_table_new(strcase_hash,strcase_equal);
build_dict.avps = g_hash_table_new(strcase_hash,strcase_equal);