diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2011-10-04 21:06:40 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2011-10-04 21:06:40 +0000 |
commit | 039fc59cb110aa485e910583d1edd5ff81ca2168 (patch) | |
tree | 60b8577999c7b5097909cf914e62f5528f75ff43 /epan/dissectors/packet-imf.c | |
parent | 19e87afd9dbf98c92f13092d99def9b09d6d8ed0 (diff) | |
download | wireshark-039fc59cb110aa485e910583d1edd5ff81ca2168.tar.gz wireshark-039fc59cb110aa485e910583d1edd5ff81ca2168.tar.bz2 wireshark-039fc59cb110aa485e910583d1edd5ff81ca2168.zip |
Free duplicated strings in hf entries.
svn path=/trunk/; revision=39259
Diffstat (limited to 'epan/dissectors/packet-imf.c')
-rw-r--r-- | epan/dissectors/packet-imf.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/epan/dissectors/packet-imf.c b/epan/dissectors/packet-imf.c index 6e4c3b0e26..31fc28baf7 100644 --- a/epan/dissectors/packet-imf.c +++ b/epan/dissectors/packet-imf.c @@ -733,22 +733,26 @@ dissect_imf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) 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; struct imf_field *imffield; - guint i = 0; + guint i; gchar *header_name; if (custom_field_table) { GList *hf_ids = g_hash_table_get_values (custom_field_table); - GList *id; + guint hf_size = g_hash_table_size (custom_field_table); /* Unregister all fields */ - for (id = hf_ids; id; id = g_list_next (id)) { - imffield = (struct imf_field *) id->data; + for (i = 0; i < hf_size; i++) { + imffield = (struct imf_field *) g_list_nth_data (hf_ids, i); proto_unregister_field (proto_imf, *(imffield->hf_id)); + g_free (imffield->hf_id); - g_free ((char *)imffield->name); + g_free ((char *) imffield->name); g_free (imffield); + 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 (custom_field_table); g_free (hf); |