diff options
author | Evan Huus <eapache@gmail.com> | 2015-04-16 07:45:39 -0400 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2015-04-16 22:40:41 +0000 |
commit | 5829f5d9994e5bf1a1cb0453015af12829f12056 (patch) | |
tree | e64a07f7bada717192c604d71c4e837469e110bb /epan | |
parent | 8825b553038c007bf8cf8f1d53dd62b13b3feb6a (diff) |
giop: replace glib with wmem
One structure and one hash table with very simple uses. Fixes a memory leak.
Change-Id: I727b7d5b0b17c2fcfaaad57797d11090e392253b
Ping-Bug: 11123
Reviewed-on: https://code.wireshark.org/review/8088
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-giop.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-giop.c b/epan/dissectors/packet-giop.c index d3f5e24b80..34d496b851 100644 --- a/epan/dissectors/packet-giop.c +++ b/epan/dissectors/packet-giop.c @@ -1063,7 +1063,7 @@ GHashTable *giop_objkey_hash = NULL; /* hash */ */ typedef struct giop_conv_info_t { - GHashTable *optypes; + wmem_map_t *optypes; } giop_conv_info_t; @@ -4856,19 +4856,19 @@ static int dissect_giop_common (tvbuff_t * tvb, packet_info * pinfo, proto_tree if(giop_info == NULL) { - giop_info = g_new0(giop_conv_info_t, 1); + giop_info = wmem_new0(wmem_file_scope(), giop_conv_info_t); - giop_info->optypes = g_hash_table_new(g_direct_hash, g_direct_equal); + giop_info->optypes = wmem_map_new(wmem_file_scope(), g_direct_hash, g_direct_equal); conversation_add_proto_data(conversation, proto_giop, giop_info); } if(header.message_type != Fragment) { /* Record the type of this request id so we can dissect it correctly later */ - g_hash_table_insert(giop_info->optypes, GUINT_TO_POINTER(header.req_id), GUINT_TO_POINTER((guint)header.message_type)); + wmem_map_insert(giop_info->optypes, GUINT_TO_POINTER(header.req_id), GUINT_TO_POINTER((guint)header.message_type)); } else if (!(header.flags & GIOP_MESSAGE_FLAGS_FRAGMENT)) { /* This is the last fragment, recoverr the original messagetype */ - message_type = (guint8)GPOINTER_TO_UINT(g_hash_table_lookup(giop_info->optypes, GUINT_TO_POINTER(header.req_id))); + message_type = (guint8)GPOINTER_TO_UINT(wmem_map_lookup(giop_info->optypes, GUINT_TO_POINTER(header.req_id))); /* We override the header message type and size */ header.message_type = message_type; |