aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/ldap
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2014-11-06 11:19:25 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2014-11-10 08:01:12 +0000
commitea167053ffc553b3a5f4ce6cbe0b78ecc8cd0dbe (patch)
treeceac2e98230e01eaf207a51ab98bd57afdddcead /asn1/ldap
parentd58567bd78abc1903191c9a955365b8d41f09496 (diff)
Improved deregistering fields.
This improvement avoids use of deallocated memory (crash) if using a deregistered field in display filter, color filter, custom column and other cases when the field is used as "interesting field". This functionality is currently used in http, imf and ldap preferences. Also removed unused proto_registrar_n() as this does not work correctly after deregistering fields. Change-Id: I043e3bf7a98bd773c9801e712a012d1eab8a7f94 Reviewed-on: https://code.wireshark.org/review/5161 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'asn1/ldap')
-rw-r--r--asn1/ldap/packet-ldap-template.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index d15715be78..9c587c5381 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -496,14 +496,10 @@ attribute_types_initialize_cb(void)
/* Unregister all fields */
for (i = 0; i < hf_size; i++) {
proto_unregister_field (proto_ldap, *(hf[i].p_id));
-
g_free (hf[i].p_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 (attribute_types_hash);
- g_free (hf);
+ proto_add_deregistered_data (hf);
attribute_types_hash = NULL;
}