aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2011-10-04 21:06:40 +0000
committerStig Bjørlykke <stig@bjorlykke.org>2011-10-04 21:06:40 +0000
commit039fc59cb110aa485e910583d1edd5ff81ca2168 (patch)
tree60b8577999c7b5097909cf914e62f5528f75ff43 /epan
parent19e87afd9dbf98c92f13092d99def9b09d6d8ed0 (diff)
Free duplicated strings in hf entries.
svn path=/trunk/; revision=39259
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-imf.c18
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);