aboutsummaryrefslogtreecommitdiff
path: root/src/feature/nodelist/dirlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature/nodelist/dirlist.c')
-rw-r--r--src/feature/nodelist/dirlist.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/feature/nodelist/dirlist.c b/src/feature/nodelist/dirlist.c
index b4abffad67..4317491043 100644
--- a/src/feature/nodelist/dirlist.c
+++ b/src/feature/nodelist/dirlist.c
@@ -1,7 +1,7 @@
/* Copyright (c) 2001 Matej Pfajfar.
* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2019, The Tor Project, Inc. */
+ * Copyright (c) 2007-2020, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
@@ -27,8 +27,9 @@
#include "core/or/or.h"
#include "app/config/config.h"
+#include "app/config/resolve_addr.h"
#include "core/or/policies.h"
-#include "feature/control/control.h"
+#include "feature/control/control_events.h"
#include "feature/dirauth/authmode.h"
#include "feature/dircommon/directory.h"
#include "feature/nodelist/dirlist.h"
@@ -70,7 +71,7 @@ add_trusted_dir_to_nodelist_addr_set(const dir_server_t *dir)
}
/** Go over the trusted directory server list and add their address(es) to the
- * nodelist address set. This is called every time a new consensus is set. */
+ * nodelist address set. This is called everytime a new consensus is set. */
MOCK_IMPL(void,
dirlist_add_trusted_dir_addresses, (void))
{
@@ -362,6 +363,9 @@ trusted_dir_server_new(const char *nickname, const char *address,
}
if (!hostname)
hostname = tor_dup_ip(a);
+
+ if (!hostname)
+ return NULL;
} else {
if (tor_lookup_hostname(address, &a)) {
log_warn(LD_CONFIG,