Wireshark-bugs: [Wireshark-bugs] [Bug 2605] Wireshark crashes on closing capture without save

Date: Mon, 16 Jun 2008 04:31:56 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2605





--- Comment #2 from Jaap Keuter <jaap.keuter@xxxxxxxxx>  2008-06-16 04:31:55 PDT ---
I've found a bug in ldap_reinit():

  /* Free up state attached to the ldap_info structures */
  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;
    }
    g_hash_table_destroy(ldap_info->matched);
    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);
  }

Check at the end. last is filled with the current ldap_conv_info_t pointer, the
next one it made current, but then that one is freed. I would say:

-    g_free(ldap_info);
+    g_free(last);


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.