aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ldap.c
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 /epan/dissectors/packet-ldap.c
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 'epan/dissectors/packet-ldap.c')
-rw-r--r--epan/dissectors/packet-ldap.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 6927b1fc92..fb9f821907 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -710,14 +710,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;
}
@@ -3824,7 +3820,7 @@ static int dissect_PasswordPolicyResponseValue_PDU(tvbuff_t *tvb _U_, packet_inf
/*--- End of included file: packet-ldap-fn.c ---*/
-#line 890 "../../asn1/ldap/packet-ldap-template.c"
+#line 886 "../../asn1/ldap/packet-ldap-template.c"
static int dissect_LDAPMessage_PDU(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, ldap_conv_info_t *ldap_info) {
int offset = 0;
@@ -5740,7 +5736,7 @@ void proto_register_ldap(void) {
NULL, HFILL }},
/*--- End of included file: packet-ldap-hfarr.c ---*/
-#line 2237 "../../asn1/ldap/packet-ldap-template.c"
+#line 2233 "../../asn1/ldap/packet-ldap-template.c"
};
/* List of subtrees */
@@ -5814,7 +5810,7 @@ void proto_register_ldap(void) {
&ett_ldap_T_warning,
/*--- End of included file: packet-ldap-ettarr.c ---*/
-#line 2251 "../../asn1/ldap/packet-ldap-template.c"
+#line 2247 "../../asn1/ldap/packet-ldap-template.c"
};
/* UAT for header fields */
static uat_field_t custom_attribute_types_uat_fields[] = {
@@ -5980,7 +5976,7 @@ proto_reg_handoff_ldap(void)
/*--- End of included file: packet-ldap-dis-tab.c ---*/
-#line 2400 "../../asn1/ldap/packet-ldap-template.c"
+#line 2396 "../../asn1/ldap/packet-ldap-template.c"
}