As pointed out by Bill [1] we leak some header_field_info structs on shutdown. This change plugs that mem leak.

[1] http://www.wireshark.org/lists/wireshark-dev/200910/msg00074.html

svn path=/trunk/; revision=30500
This commit is contained in:
Kovarththanan Rajaratnam 2009-10-11 09:18:51 +00:00
parent 34e05c76f7
commit ee9ea561d2
1 changed files with 10 additions and 1 deletions

View File

@ -428,6 +428,15 @@ proto_cleanup(void)
while (protocols) {
protocol_t *protocol = protocols->data;
header_field_info *hfinfo;
PROTO_REGISTRAR_GET_NTH(protocol->proto_id, hfinfo);
DISSECTOR_ASSERT(protocol->proto_id == hfinfo->id);
#if GLIB_CHECK_VERSION(2,10,0)
g_slice_free(header_field_info, hfinfo);
#else
g_mem_chunk_free(gmc_hfinfo, hfinfo);
#endif
g_list_free(protocol->fields);
protocols = g_list_remove(protocols, protocol);
@ -3828,7 +3837,7 @@ proto_register_protocol(const char *name, const char *short_name, const char *fi
/* Add this protocol to the list of known protocols; the list
is sorted by protocol short name. */
protocol = g_malloc(sizeof (protocol_t));
protocol = g_new(protocol_t, 1);
protocol->name = name;
protocol->short_name = short_name;
protocol->filter_name = filter_name;