diff options
author | Guy Harris <guy@alum.mit.edu> | 2016-04-28 14:46:31 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2016-04-28 21:47:04 +0000 |
commit | 65c6f79ddcc1f97f76bf6ddf0bc64826cf479254 (patch) | |
tree | e921fc31fdeb6e502c2cba1d7434f8cb3e8a467e /epan | |
parent | 3eef66b2c259e4228d92c59140c60d4b59072814 (diff) |
Cleanups to issues found while investigating 12386.
Get rid of the printable-IP-address member of a sub_net_hashipv4; it's
not used.
Free hash buckets of those structures iteratively, not recursively.
Change-Id: I1ee8f46d3175a380e6a439fe71e7c06a0e939a3d
Reviewed-on: https://code.wireshark.org/review/15150
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/addr_resolv.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index 080b77964a..06c3ac1601 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -130,7 +130,6 @@ typedef struct sub_net_hashipv4 { guint addr; guint8 flags; /* B0 dummy_entry, B1 resolve, B2 If the address is used in the trace */ struct sub_net_hashipv4 *next; - gchar ip[16]; gchar name[MAXNAMELEN]; } sub_net_hashipv4_t; @@ -2350,16 +2349,6 @@ subnet_name_lookup_init(void) g_free(subnetspath); } -static void -cleanup_subnet_entry(sub_net_hashipv4_t* entry) -{ - if ((entry != NULL) && (entry->next != NULL)) { - cleanup_subnet_entry(entry->next); - } - - wmem_free(wmem_epan_scope(), entry); -} - /* * External Functions */ @@ -2713,6 +2702,8 @@ void host_name_lookup_cleanup(void) { guint32 i, j; + sub_net_hashipv4_t *entry, *next_entry; + _host_name_lookup_cleanup(); if (ipxnet_hash_table) { @@ -2733,9 +2724,10 @@ host_name_lookup_cleanup(void) for(i = 0; i < SUBNETLENGTHSIZE; ++i) { if (subnet_length_entries[i].subnet_addresses != NULL) { for (j = 0; j < HASHHOSTSIZE; j++) { - if (subnet_length_entries[i].subnet_addresses[j] != NULL) - { - cleanup_subnet_entry(subnet_length_entries[i].subnet_addresses[j]); + for (entry = subnet_length_entries[i].subnet_addresses[j]; + entry != NULL; entry = next_entry) { + next_entry = entry->next; + wmem_free(wmem_epan_scope(), entry); } } wmem_free(wmem_epan_scope(), subnet_length_entries[i].subnet_addresses); |