From fdde3f7c84b882d3384f07c6512a16693e58367f Mon Sep 17 00:00:00 2001 From: hypherion2 Date: Wed, 24 Jun 2015 11:51:17 -0700 Subject: [PATCH] Initialize pointer to NULL Prevents a crash freeing unallocated memory in ares_destroy_internal if the servers pointer is never populated. This is the case on Android if no network is available on boot. --- rutil/dns/ares/ares_init.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rutil/dns/ares/ares_init.c b/rutil/dns/ares/ares_init.c index a8ca11f243..30c8a4f03b 100644 --- a/rutil/dns/ares/ares_init.c +++ b/rutil/dns/ares/ares_init.c @@ -167,6 +167,7 @@ int ares_init_options_with_socket_function(ares_channel *channelptr, struct ares channel->ndomains = -1; channel->nsort = -1; channel->lookups = NULL; + channel->servers = NULL; /* Initialize configuration by each of the four sources, from highest * precedence to lowest.