diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-10-04 21:06:20 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-10-04 21:06:20 +0000 |
commit | 2235e253c8941100c37c42a2b7a33f5bfbd4748e (patch) | |
tree | 9ae03035a432b8c251590eb5dde9ad706ba17d44 /epan | |
parent | ce2a9876d6956eeeebf0fbbf5b4df72157502d4d (diff) |
Free duplicated strings in hf entries.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39258 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-http.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/epan/dissectors/packet-http.c b/epan/dissectors/packet-http.c index b524fb8d07..a00d35a240 100644 --- a/epan/dissectors/packet-http.c +++ b/epan/dissectors/packet-http.c @@ -1902,19 +1902,23 @@ get_hf_for_header(char* header_name) static void header_fields_initialize_cb(void) { - static hf_register_info* hf = NULL; - gint* hf_id = NULL; + static hf_register_info* hf; + gint* hf_id; guint i; gchar* header_name; if (header_fields_hash) { GList *hf_ids = g_hash_table_get_values (header_fields_hash); - GList *id; + guint hf_size = g_hash_table_size (header_fields_hash); /* Unregister all fields */ - for (id = hf_ids; id; id = g_list_next (id)) { - hf_id = (int *) id->data; + for (i = 0; i < hf_size; i++) { + hf_id = (int *) g_list_nth_data (hf_ids, i); proto_unregister_field (proto_http, *hf_id); + g_free (hf_id); + g_free ((char *) hf[i].hfinfo.name); + g_free ((char *) hf[i].hfinfo.abbrev); + g_free ((char *) hf[i].hfinfo.blurb); } g_hash_table_destroy (header_fields_hash); g_free (hf); |