From 179e0fbc11fda7a2643097d4c67685953fdf5e2f Mon Sep 17 00:00:00 2001 From: Dario Lombardo Date: Wed, 1 Feb 2017 14:40:56 +0100 Subject: imf: convert GHashTable to wmem_map Change-Id: Ia5bd6af88db76bbe4e0a267c30b6f7749b23e299 Reviewed-on: https://code.wireshark.org/review/19903 Reviewed-by: Michael Mann Petri-Dish: Dario Lombardo Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo --- epan/dissectors/packet-imf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'epan/dissectors/packet-imf.c') diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 54e7c8e4c6..91b6935b6e 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -282,7 +282,7 @@ static struct imf_field imf_fields[] = { {NULL, NULL, NULL, FALSE}, }; -static GHashTable *imf_field_table=NULL; +static wmem_map_t *imf_field_table=NULL; #define FORMAT_UNSTRUCTURED 0 #define FORMAT_MAILBOX 1 @@ -773,7 +773,7 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_) ascii_strdown_inplace (key); /* look up the key in built-in fields */ - f_info = (struct imf_field *)g_hash_table_lookup(imf_field_table, key); + f_info = (struct imf_field *)wmem_map_lookup(imf_field_table, key); if(f_info == NULL && custom_field_table) { /* look up the key in custom fields */ @@ -1335,11 +1335,11 @@ proto_register_imf(void) "setup and used for filtering/data extraction etc.", headers_uat); - imf_field_table=g_hash_table_new(g_str_hash, g_str_equal); /* oid to syntax */ + imf_field_table=wmem_map_new(wmem_epan_scope(), wmem_str_hash, g_str_equal); /* oid to syntax */ /* register the fields for lookup */ for(f = imf_fields; f->name; f++) - g_hash_table_insert(imf_field_table, (gpointer)f->name, (gpointer)f); + wmem_map_insert(imf_field_table, (gpointer)f->name, (gpointer)f); /* Register for tapping */ imf_eo_tap = register_export_object(proto_imf, imf_eo_packet, NULL); -- cgit v1.2.1