From 19a95385be68534d92ee284d024b4868510d62cd Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Mon, 17 Mar 2008 12:03:36 +0000 Subject: 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 --- asn1/ldap/packet-ldap-template.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'asn1') 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; -- cgit v1.2.3