diff options
author | Dario Lombardo <lomato@gmail.com> | 2017-02-01 13:53:19 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-02-01 16:07:12 +0000 |
commit | 401a20dbd43feab18931d4baa5984daf8806a7e8 (patch) | |
tree | d918e9d5b947e148c4ec1d24b1826904bc78508a /epan/dissectors/packet-ieee802a.c | |
parent | 57d270549b68738dd2c10e8fa6c600455e9bc72c (diff) |
ieee802a: add shutdown routine.
Change-Id: I21d0ab5619cde9a43b96eaff351fa338e317f4f9
Reviewed-on: https://code.wireshark.org/review/19897
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ieee802a.c')
-rw-r--r-- | epan/dissectors/packet-ieee802a.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ieee802a.c b/epan/dissectors/packet-ieee802a.c index 0d9f9c5561..f2eb0b08ce 100644 --- a/epan/dissectors/packet-ieee802a.c +++ b/epan/dissectors/packet-ieee802a.c @@ -68,8 +68,8 @@ ieee802a_add_oui(guint32 oui, const char *table_name, const char *table_ui_name, * already exist. */ if (oui_info_table == NULL) { - oui_info_table = g_hash_table_new(g_direct_hash, - g_direct_equal); + oui_info_table = g_hash_table_new_full(g_direct_hash, + g_direct_equal, NULL, g_free); } g_hash_table_insert(oui_info_table, GUINT_TO_POINTER(oui), new_info); } @@ -137,6 +137,12 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data return tvb_captured_length(tvb); } +static void +ieee802a_shutdown(void) +{ + g_hash_table_destroy(oui_info_table); +} + void proto_register_ieee802a(void) { @@ -156,6 +162,7 @@ proto_register_ieee802a(void) proto_ieee802a = proto_register_protocol("IEEE802a OUI Extended Ethertype", "IEEE802a", "ieee802a"); proto_register_field_array(proto_ieee802a, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + register_shutdown_routine(ieee802a_shutdown); } static void |