aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-04-22 16:44:19 -0700
committerGuy Harris <guy@alum.mit.edu>2016-04-22 23:45:37 +0000
commit3db13c7bbbc2b8dfd864ffe7278c0f8f5491bfc7 (patch)
tree6aa69d54a282aee33d62dd9627cda8121bf14414 /epan/addr_resolv.c
parent249f87aeee1f0171dbea6128b96de5b625b3b930 (diff)
Don't fail in host_name_lookup_init() if manually resolved lists exist.
Those lists aren't destroyed by host_name_lookup_cleanup(), so don't assume in host_name_lookup_init() that they don't exist; just create them if they don't exist and leave them alone if they do. (GSLists and GLists are different from wmem_lists - a pointer to a GLib list is just a pointer to a list element, so an empty list is represented by a null pointer, but a wmem_list has a structure containing other information, so an empty list has null list pointers in that structure, and a null wmem_list * means the list doesn't exist at all.) Change-Id: I88c00cc9ac0812ab71adc70e3300ab3829fee8ab Reviewed-on: https://code.wireshark.org/review/15061 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r--epan/addr_resolv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index f38e593ae9..5b330bfa7e 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -2657,11 +2657,11 @@ host_name_lookup_init(void)
g_assert(async_dns_queue_head == NULL);
async_dns_queue_head = wmem_list_new(wmem_epan_scope());
- g_assert(manually_resolved_ipv4_list == NULL);
- manually_resolved_ipv4_list = wmem_list_new(wmem_epan_scope());
+ if (manually_resolved_ipv4_list == NULL)
+ manually_resolved_ipv4_list = wmem_list_new(wmem_epan_scope());
- g_assert(manually_resolved_ipv6_list == NULL);
- manually_resolved_ipv6_list = wmem_list_new(wmem_epan_scope());
+ if (manually_resolved_ipv6_list == NULL)
+ manually_resolved_ipv6_list = wmem_list_new(wmem_epan_scope());
/*
* Load the global hosts file, if we have one.