aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authorJeff Morriss <jeff.morriss@ulticom.com>2008-03-17 12:03:36 +0000
committerJeff Morriss <jeff.morriss@ulticom.com>2008-03-17 12:03:36 +0000
commit19a95385be68534d92ee284d024b4868510d62cd (patch)
tree41284b050c556d804f9bf248620307b14a076a90 /asn1
parentd69054190567b5be32aef0884533860d7b4953f5 (diff)
There are several g_malloc()'d things hanging off ldasp_conv_info_t's so don't se_ alloc that structure but rather g_malloc() it and free it after we've freed the contents. This fixes the LDAP part of the crash from http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1113
svn path=/trunk/; revision=24664
Diffstat (limited to 'asn1')
-rw-r--r--asn1/ldap/packet-ldap-template.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index 3bedd544f7..4dea39ba27 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -692,7 +692,7 @@ dissect_ldap_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean i
/* No. Attach that information to the conversation, and add
* it to the list of information structures.
*/
- ldap_info = se_alloc(sizeof(ldap_conv_info_t));
+ ldap_info = g_malloc(sizeof(ldap_conv_info_t));
ldap_info->auth_type = 0;
ldap_info->auth_mech = 0;
ldap_info->first_auth_frame = 0;
@@ -1477,7 +1477,9 @@ ldap_reinit(void)
ldap_conv_info_t *ldap_info;
/* Free up state attached to the ldap_info structures */
- for (ldap_info = ldap_info_items; ldap_info != NULL; ldap_info = ldap_info->next) {
+ for (ldap_info = ldap_info_items; ldap_info != NULL; ) {
+ ldap_conv_info_t *last;
+
if (ldap_info->auth_mech != NULL) {
g_free(ldap_info->auth_mech);
ldap_info->auth_mech=NULL;
@@ -1486,6 +1488,10 @@ ldap_reinit(void)
ldap_info->matched=NULL;
g_hash_table_destroy(ldap_info->unmatched);
ldap_info->unmatched=NULL;
+
+ last = ldap_info;
+ ldap_info = ldap_info->next;
+ g_free(ldap_info);
}
ldap_info_items = NULL;