diff options
author | rl1987 <rl1987@users.noreply.github.com> | 2020-05-21 14:17:15 +0300 |
---|---|---|
committer | rl1987 <rl1987@users.noreply.github.com> | 2020-05-21 14:17:15 +0300 |
commit | a5d28bf88f839c21fbefde8391d777fd9610abd3 (patch) | |
tree | 0d136fa3df36dba4cfdd230c0cb1b1d98456a0bd /src/feature/nodelist/authcert.c | |
parent | ded99992b831bfff782a3b3c612297a4634d3d88 (diff) | |
download | tor-a5d28bf88f839c21fbefde8391d777fd9610abd3.tar.gz tor-a5d28bf88f839c21fbefde8391d777fd9610abd3.zip |
Check for NULL from tor_dup_ip()
Diffstat (limited to 'src/feature/nodelist/authcert.c')
-rw-r--r-- | src/feature/nodelist/authcert.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/feature/nodelist/authcert.c b/src/feature/nodelist/authcert.c index 9c7525b6e2..97e44d53e3 100644 --- a/src/feature/nodelist/authcert.c +++ b/src/feature/nodelist/authcert.c @@ -464,11 +464,13 @@ trusted_dirs_load_certs_from_string(const char *contents, int source, (ds->addr != cert->addr || ds->dir_port != cert->dir_port)) { char *a = tor_dup_ip(cert->addr); - log_notice(LD_DIR, "Updating address for directory authority %s " - "from %s:%d to %s:%d based on certificate.", - ds->nickname, ds->address, (int)ds->dir_port, - a, cert->dir_port); - tor_free(a); + if (a) { + log_notice(LD_DIR, "Updating address for directory authority %s " + "from %s:%d to %s:%d based on certificate.", + ds->nickname, ds->address, (int)ds->dir_port, + a, cert->dir_port); + tor_free(a); + } ds->addr = cert->addr; ds->dir_port = cert->dir_port; } |