aboutsummaryrefslogtreecommitdiffstats
path: root/epan/addr_resolv.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-03-03 00:07:26 -0800
committerGuy Harris <guy@alum.mit.edu>2018-03-03 08:08:02 +0000
commit302fa6881751e5a8f9c8c197ab0008ee336e821a (patch)
tree894fc0f525db81a16137bdc455063e3e1fa06391 /epan/addr_resolv.c
parent07cb624e48a8606ba4b603f94caa0e92853a1559 (diff)
Don't crash in manually_resolve_cleanup() if there's nothing to clean up.
We might not yet have allocated the manually-resolved address lists; only free the if we have. Change-Id: Iff9864e397a04cdcb613268603c073ecd1fa77fb Reviewed-on: https://code.wireshark.org/review/26236 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/addr_resolv.c')
-rw-r--r--epan/addr_resolv.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c
index a70a7210b8..1cae8a5733 100644
--- a/epan/addr_resolv.c
+++ b/epan/addr_resolv.c
@@ -2810,10 +2810,14 @@ host_name_lookup_cleanup(void)
void
manually_resolve_cleanup(void)
{
- wmem_destroy_list(manually_resolved_ipv4_list);
- manually_resolved_ipv4_list = NULL;
- wmem_destroy_list(manually_resolved_ipv6_list);
- manually_resolved_ipv6_list = NULL;
+ if (manually_resolved_ipv4_list) {
+ wmem_destroy_list(manually_resolved_ipv4_list);
+ manually_resolved_ipv4_list = NULL;
+ }
+ if (manually_resolved_ipv6_list) {
+ wmem_destroy_list(manually_resolved_ipv6_list);
+ manually_resolved_ipv6_list = NULL;
+ }
}
gchar *